forked from cerc-io/laconicd-deprecated
c626a5c8ee
* tests(json-rpc): wip evm_backend unit test setup * tests(json-rpc): wip evm_backend unit test setup * fix viper * wip query client mock * fix first backend test except error message * clean up * wip Context with Height * fix JSON RPC backend test setup * typo * refactor folder structure * Update rpc/backend/evm_backend_test.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
31 lines
554 B
Go
31 lines
554 B
Go
package backend
|
|
|
|
import "github.com/ethereum/go-ethereum/common/hexutil"
|
|
|
|
func (suite *BackendTestSuite) TestBlockNumber() {
|
|
testCases := []struct {
|
|
mame string
|
|
malleate func()
|
|
expBlockNumber hexutil.Uint64
|
|
expPass bool
|
|
}{
|
|
{
|
|
"pass",
|
|
func() {
|
|
},
|
|
0x1,
|
|
true,
|
|
},
|
|
}
|
|
for _, tc := range testCases {
|
|
blockNumber, err := suite.backend.BlockNumber()
|
|
|
|
if tc.expPass {
|
|
suite.Require().NoError(err)
|
|
suite.Require().Equal(tc.expBlockNumber, blockNumber)
|
|
} else {
|
|
suite.Require().Error(err)
|
|
}
|
|
}
|
|
}
|