Skip to content

Commit

Permalink
Removing the workaround to handle the pre-Byzantium status field in G…
Browse files Browse the repository at this point in the history
…raphQL queries to geth,

as it has been fixed upstream (ethereum/go-ethereum#24124).
  • Loading branch information
amyodov committed Jan 11, 2022
1 parent 700e469 commit 334cfb3
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,7 @@ class EthereumSingleNodeGraphQLConnector(nodeUrl: String,
value = tr.value,
// *** Mined transaction ***
// "status" – EIP 658, since Byzantium fork
// using Option(nullable).
// But there seems to be a bug in GraphQL handling pre-Byzantium statuses,
// (https://github.com/ethereum/go-ethereum/issues/24124)
// So need to handle this manually.
status = blockNumber match {
case preByzantium if preByzantium < EthUtils.BYZANTIUM_FIRST_BLOCK =>
None
case byzantiumAndNewer =>
tr.status.map(Math.toIntExact) // Option[Long] to Option[Int]
},
status = tr.status.map(Math.toIntExact), // Option[Long] to Option[Int]
blockNumber = tr.block.get.number, // block must exist!
transactionIndex = tr.index.get, // transaction must exist!
gasUsed = tr.gasUsed.get, // presumed non-null if mined
Expand Down

0 comments on commit 334cfb3

Please sign in to comment.