Skip to content

graphql: standardize test outputs #475

Open
@s1na

Description

@s1na

There are multiple GraphQL hive tests where due to historical reasons 2 responses are accepted. This is unfortunate. The aim of this issue to discuss and agree on one output. The following tests have 2 acceptable responses:

  • 17_eth_getBlock_byNumberInvalid.json tries to get a block by a number that doesn't exist in the chain (88888888)
  • 07_eth_gasPrice.json accepts both 0x10 and 0x1 as valid responses
  • 30_eth_getTransaction_byHash.json this returns a transaction object. it accepts 2 responses. As far as I can tell these are the differences:
    • index being 0 vs 0x0. We should use 0x0 here now that all integer values are hex-encoded
    • log.index being 0 vs 0x0. Same as above.
    • status being null vs 0x0. I'm not sure why status should be null here. IMO we should return 0x0.
  • 33_eth_getTransactionReceipt.json as far as I can tell only difference is index being 0 vs 0x0. Should use 0x0.

The following testcase also accepts 2 responses. Either an error, or simply a nil value. It gets the balance of an account against a block which shouldnt exist. However since we've added new block the query has now actually a correct response. It needs to be updated with another block number.

  • 12_eth_getBalance_toobig_bn.json

We need to agree what to do for 12 and 17. It boils down to this: when a resource does not exist, return null or error. IMO to stay consistent with JSON-RPC we should return null. Also this is not really an exception.

Not sure what to do for 07_eth_gasPrice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions