Skip to content

Commit

Permalink
RPC API compatibility test (#227)
Browse files Browse the repository at this point in the history
Adds a test which compares the RPC API outputs of a celo-blockchain node
and an op-geth node using a migrated version of the datadir used by the
celo node.

The test is segregated from normal compilation by the build tag
'compat_test'.

The intent of this test is to ensure that our cel2 nodes will return rpc
api responses for historical data that are consistent with the
celo-blockchain node.

Run it like this:

go test -v ./compat_test -tags compat_test -celo-url '<celo rpc url>'  -op-geth-url '<op-geth rpc url>'

The build tag disables static analysis in vscode so if you still want
that you need to add the build tag to your preferences:
{
  ...
  "go.buildTags": "compat_test",
  ...
}

Also updates json transaction unmarshaling to be able to handle
unmarshaling from a celo-node, and adds a utility function in the types
package to help make transactions comparable. We'll want to remove these
at a later date since they exist solely support running this test.

Co-authored-by: Karl Bartel <[email protected]>
  • Loading branch information
piersy and karlb authored Sep 30, 2024
1 parent db278f4 commit 13f6cb6
Show file tree
Hide file tree
Showing 4 changed files with 1,414 additions and 2 deletions.
Loading

0 comments on commit 13f6cb6

Please sign in to comment.