was meant to fix the for select lint, but Alex already did (#6557)

This commit is contained in:
Leonard Chinonso 2023-01-11 14:27:05 +00:00 committed by GitHub
parent bd0e636446
commit a4751aacdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,6 +66,40 @@ func TestRequestGenerator_GetBalance(t *testing.T) {
}
}
func TestRequestGenerator_GetBlockByNumber(t *testing.T) {
testCases := []struct {
reqId int
blockNum uint64
withTxs bool
expected string
}{
{
1,
2,
false,
`{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x2",false],"id":1}`,
},
{
2,
16,
false,
`{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x10",false],"id":2}`,
},
{
3,
100,
true,
`{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x64",true],"id":3}`,
},
}
for _, testCase := range testCases {
reqGen := MockRequestGenerator(testCase.reqId)
got := reqGen.GetBlockByNumber(testCase.blockNum, testCase.withTxs)
require.EqualValues(t, testCase.expected, got)
}
}
func TestRequestGenerator_GetLogs(t *testing.T) {
testCases := []struct {
reqId int