Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: docgen: use real values for Eth types #9938

Merged
merged 1 commit into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion api/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,10 @@ func init() {
addExample(ethint)
addExample(&ethint)
ethaddr, _ := ethtypes.EthAddressFromHex("0x5CbEeCF99d3fDB3f25E309Cc264f240bb0664031")
addExample(ethaddr)
addExample(&ethaddr)
ethhash, _ := ethtypes.NewEthHashFromCid(c)
addExample(ethhash)
addExample(&ethhash)

ethFeeHistoryReward := [][]ethtypes.EthBigInt{}
Expand Down Expand Up @@ -468,7 +470,7 @@ func ExampleValue(method string, t, parent reflect.Type) interface{} {
case reflect.Ptr:
if t.Elem().Kind() == reflect.Struct {
es := exampleStruct(method, t.Elem(), t)
// ExampleValues[t] = es
ExampleValues[t] = es
return es
}
case reflect.Interface:
Expand Down
Binary file modified build/openrpc/full.json.gz
Binary file not shown.
84 changes: 42 additions & 42 deletions documentation/en/api-v1-unstable-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@ Inputs: `null`
Response:
```json
[
"0x0707070707070707070707070707070707070707"
"0x5cbeecf99d3fdb3f25e309cc264f240bb0664031"
]
```

Expand Down Expand Up @@ -2366,7 +2366,7 @@ Perms: read
Inputs:
```json
[
"0x0707070707070707070707070707070707070707",
"0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"string value"
]
```
Expand All @@ -2381,21 +2381,21 @@ Perms: read
Inputs:
```json
[
"0x0707070707070707070707070707070707070707070707070707070707070707",
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
true
]
```

Response:
```json
{
"hash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"parentHash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"sha3Uncles": "0x0707070707070707070707070707070707070707070707070707070707070707",
"miner": "0x0707070707070707070707070707070707070707",
"stateRoot": "0x0707070707070707070707070707070707070707070707070707070707070707",
"transactionsRoot": "0x0707070707070707070707070707070707070707070707070707070707070707",
"receiptsRoot": "0x0707070707070707070707070707070707070707070707070707070707070707",
"hash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"parentHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"sha3Uncles": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"miner": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"stateRoot": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"transactionsRoot": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"receiptsRoot": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"logsBloom": "0x07",
"difficulty": "0x5",
"totalDifficulty": "0x5",
Expand All @@ -2404,15 +2404,15 @@ Response:
"gasUsed": "0x5",
"timestamp": "0x5",
"extraData": "Ynl0ZSBhcnJheQ==",
"mixHash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"mixHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"nonce": "0x0707070707070707",
"baseFeePerGas": "0x0",
"size": "0x5",
"transactions": [
{}
],
"uncles": [
"0x0707070707070707070707070707070707070707070707070707070707070707"
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"
]
}
```
Expand All @@ -2433,13 +2433,13 @@ Inputs:
Response:
```json
{
"hash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"parentHash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"sha3Uncles": "0x0707070707070707070707070707070707070707070707070707070707070707",
"miner": "0x0707070707070707070707070707070707070707",
"stateRoot": "0x0707070707070707070707070707070707070707070707070707070707070707",
"transactionsRoot": "0x0707070707070707070707070707070707070707070707070707070707070707",
"receiptsRoot": "0x0707070707070707070707070707070707070707070707070707070707070707",
"hash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"parentHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"sha3Uncles": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"miner": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"stateRoot": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"transactionsRoot": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"receiptsRoot": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"logsBloom": "0x07",
"difficulty": "0x5",
"totalDifficulty": "0x5",
Expand All @@ -2448,15 +2448,15 @@ Response:
"gasUsed": "0x5",
"timestamp": "0x5",
"extraData": "Ynl0ZSBhcnJheQ==",
"mixHash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"mixHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"nonce": "0x0707070707070707",
"baseFeePerGas": "0x0",
"size": "0x5",
"transactions": [
{}
],
"uncles": [
"0x0707070707070707070707070707070707070707070707070707070707070707"
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"
]
}
```
Expand All @@ -2470,7 +2470,7 @@ Perms: read
Inputs:
```json
[
"0x0707070707070707070707070707070707070707070707070707070707070707"
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"
]
```

Expand Down Expand Up @@ -2499,7 +2499,7 @@ Perms: read
Inputs:
```json
[
"0x0707070707070707070707070707070707070707",
"0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"string value"
]
```
Expand Down Expand Up @@ -2648,7 +2648,7 @@ Perms: read
Inputs:
```json
[
"0x0707070707070707070707070707070707070707",
"0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"0x07",
"string value"
]
Expand All @@ -2664,7 +2664,7 @@ Perms: read
Inputs:
```json
[
"0x0707070707070707070707070707070707070707070707070707070707070707",
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"0x5"
]
```
Expand All @@ -2674,11 +2674,11 @@ Response:
{
"chainId": "0x5",
"nonce": "0x5",
"hash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"hash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockNumber": "0x5",
"transactionIndex": "0x5",
"from": "0x0707070707070707070707070707070707070707",
"from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"value": "0x0",
"type": "0x5",
Expand Down Expand Up @@ -2710,11 +2710,11 @@ Response:
{
"chainId": "0x5",
"nonce": "0x5",
"hash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"hash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockNumber": "0x5",
"transactionIndex": "0x5",
"from": "0x0707070707070707070707070707070707070707",
"from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"value": "0x0",
"type": "0x5",
Expand Down Expand Up @@ -2745,11 +2745,11 @@ Response:
{
"chainId": "0x5",
"nonce": "0x5",
"hash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"hash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockNumber": "0x5",
"transactionIndex": "0x5",
"from": "0x0707070707070707070707070707070707070707",
"from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"value": "0x0",
"type": "0x5",
Expand All @@ -2771,7 +2771,7 @@ Perms: read
Inputs:
```json
[
"0x0707070707070707070707070707070707070707",
"0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"string value"
]
```
Expand All @@ -2786,20 +2786,20 @@ Perms: read
Inputs:
```json
[
"0x0707070707070707070707070707070707070707070707070707070707070707"
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"
]
```

Response:
```json
{
"transactionHash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"transactionIndex": "0x5",
"blockHash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockNumber": "0x5",
"from": "0x0707070707070707070707070707070707070707",
"from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"root": "0x0707070707070707070707070707070707070707070707070707070707070707",
"root": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"status": "0x5",
"contractAddress": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"cumulativeGasUsed": "0x5",
Expand All @@ -2808,16 +2808,16 @@ Response:
"logsBloom": "0x07",
"logs": [
{
"address": "0x0707070707070707070707070707070707070707",
"address": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
"data": "0x07",
"topics": [
"0x07"
],
"removed": true,
"logIndex": "0x5",
"transactionIndex": "0x5",
"transactionHash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"blockHash": "0x0707070707070707070707070707070707070707070707070707070707070707",
"transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e",
"blockNumber": "0x5"
}
],
Expand Down Expand Up @@ -3004,7 +3004,7 @@ Inputs:
]
```

Response: `"0x0707070707070707070707070707070707070707070707070707070707070707"`
Response: `"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"`

### EthSubscribe
Subscribe to different event types using websockets
Expand All @@ -3025,7 +3025,7 @@ Inputs:
{
"topics": [
[
"0x0707070707070707070707070707070707070707070707070707070707070707"
"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"
]
]
}
Expand Down