graphql: return decimal for estimateGas and cumulativeGas queries (#22126)

* estimateGas, cumulativeGas
* linted
* add test for estimateGas
This commit is contained in:
rene
2021-01-06 17:19:16 +01:00
committed by GitHub
parent d667ee2d10
commit 072fd96254
2 changed files with 20 additions and 13 deletions

View File

@ -117,6 +117,12 @@ func TestGraphQLBlockSerialization(t *testing.T) {
want: `{"errors":[{"message":"Cannot query field \"bleh\" on type \"Query\".","locations":[{"line":1,"column":2}]}]}`,
code: 400,
},
// should return `estimateGas` as decimal
{
body: `{"query": "{block{ estimateGas(data:{}) }}"}`,
want: `{"data":{"block":{"estimateGas":53000}}}`,
code: 200,
},
} {
resp, err := http.Post(fmt.Sprintf("http://%s/graphql", "127.0.0.1:9393"), "application/json", strings.NewReader(tt.body))
if err != nil {