Skip to content

Commit

Permalink
CNS-24: add tests for Polygon ifaces to spec
Browse files Browse the repository at this point in the history
Add more tests for bor_... methods.
  • Loading branch information
orenl-lava committed Jan 24, 2023
1 parent ef0fb82 commit 7944382
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions relayer/testclients/polygon_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,24 @@ const (
// JSONRPC_ETH_BLOCKNUMBER (defined in relayer/testclients/test_utils.go)
// JSONRPC_ETH_GETBALANCE (defined in relayer/testclients/test_utils.go)
// JSONRPC_ETH_NEWFILTER (defined in relayer/testclients/test_utils.go)
JSONRPC_BOR_GETAUTHOR = `{"jsonrpc":"2.0","method":"bor_getAuthor","params":["0x1000"],"id":1}`
JSONRPC_BOR_GETCURRENTVALIDATORS = `{"jsonrpc":"2.0","method":"bor_getCurrentValidators","id":1}`
JSONRPC_BOR_GETCURRENTPROPOSER = `{"jsonrpc":"2.0","method":"bor_getCurrentProposer","id":1}`
JSONRPC_BOR_GETROOTHASH = `{"jsonrpc":"2.0","method":"bor_getRootHash","params":[1024,1026],"id":1}`
JSONRPC_BOR_GETSIGNERSATHASH = `{"jsonrpc":"2.0","method":"bor_getSignersAtHash","params":["0x29fa73e3da83ddac98f527254fe37002e052725a88904bac14f03e919e1e2876"],"id":1}`
JSONRPC_ETH_GETROOTHASH = `{"jsonrpc":"2.0","method":"eth_getRootHash","params":[1024,1026],"id":1}`
)

var polygon_tests = []struct{ name, payload string }{
{ "eth_blockNumber", JSONRPC_ETH_BLOCKNUMBER },
{ "eth_getBalance", JSONRPC_ETH_GETBALANCE },
{ "eth_newFilter", JSONRPC_ETH_NEWFILTER },
{ "bor_getAuthor", JSONRPC_BOR_GETAUTHOR },
{ "bor_getCurrentValidators", JSONRPC_BOR_GETCURRENTVALIDATORS },
{ "bor_getCurrentProposer", JSONRPC_BOR_GETCURRENTPROPOSER },
{ "bor_getSignersAtHash", JSONRPC_BOR_GETSIGNERSATHASH },
{ "bor_getRootHash", JSONRPC_BOR_GETROOTHASH },
{ "eth_getRootHash", JSONRPC_ETH_GETROOTHASH },
}

func PolygonTests(ctx context.Context, chainID string, rpcURL string, chainProxy chainproxy.ChainProxy, privKey *btcec.PrivateKey, testDuration time.Duration) error {
Expand Down

0 comments on commit 7944382

Please sign in to comment.