Skip to content

graphql: Return Long for gas, gasUsed, cumulativeGasUsed, estimateGas, and status #20040

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

Closed
adamschmideg opened this issue Sep 6, 2019 · 4 comments
Assignees
Milestone

Comments

@adamschmideg
Copy link
Contributor

The current GraphQL schema defines Long as a 64-bit unsigned integer. The values of gas, gasUsed, cumulativeGasUsed, estimateGas, and status are now returned as BigInt encoded as a 0x-prefixed string. They should return a number instead.

Reproduce running this query

query pending {
  block(number:1) {
    transactions {
      gas
      gasUsed
      cumulativeGasUsed
      status
    }
    estimateGas(data: {})
  }
}
@karalabe
Copy link
Member

Unfortunately JavaScript does not support 64 bit ints, so we must return hex strings.

More details at graphql/graphql-spec#73.

The schema should be changed.

@karalabe
Copy link
Member

status should probably be an int? Does that support null?

@karalabe karalabe added this to the 1.9.4 milestone Sep 10, 2019
@adamschmideg
Copy link
Contributor Author

status: Int should be fine, it supports null (as opposed to status: Int! which makes it non-nullable)

@karalabe karalabe modified the milestones: 1.9.4, 1.9.5 Sep 19, 2019
@fjl fjl modified the milestones: 1.9.5, 1.9.6 Sep 20, 2019
@fjl fjl modified the milestones: 1.9.6, 1.9.7 Oct 3, 2019
@karalabe karalabe modified the milestones: 1.9.7, 1.9.8 Nov 8, 2019
@karalabe karalabe modified the milestones: 1.9.8, 1.9.9 Nov 27, 2019
@karalabe karalabe modified the milestones: 1.9.9, 1.9.10 Dec 6, 2019
@karalabe karalabe modified the milestones: 1.9.10, 1.9.11 Jan 21, 2020
@karalabe karalabe modified the milestones: 1.9.11, 1.9.12 Feb 18, 2020
@karalabe karalabe modified the milestones: 1.9.12, 1.9.13 Mar 16, 2020
@karalabe karalabe modified the milestones: 1.9.13, 1.9.14 Apr 20, 2020
@karalabe karalabe modified the milestones: 1.9.14, 1.9.15 May 13, 2020
@karalabe karalabe modified the milestones: 1.9.15, 1.9.16 Jun 8, 2020
@fjl fjl removed this from the 1.9.16 milestone Jul 10, 2020
@fjl fjl added this to the 1.9.17 milestone Jul 10, 2020
@karalabe karalabe modified the milestones: 1.9.17, 1.9.18, 1.9.19 Jul 20, 2020
@karalabe karalabe modified the milestones: 1.9.19, 1.9.20 Aug 11, 2020
@karalabe karalabe modified the milestones: 1.9.20, 1.9.21 Aug 26, 2020
@renaynay renaynay assigned renaynay and unassigned adamschmideg Nov 22, 2020
@renaynay
Copy link
Contributor

The following PRs have resolved this issue:
#21883
#22153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants