From 56c1f67d41e2cae55bba3e1a32a1f4bf5cabc88c Mon Sep 17 00:00:00 2001 From: mralj Date: Sat, 28 Sep 2024 13:00:06 +0200 Subject: [PATCH] added missing mocks for tests --- core/vm/contracts_rollup.go | 2 +- eth/tracers/api_rollup_test.go | 7 +++++++ internal/ethapi/api_rollup_test.go | 7 +++++++ internal/ethapi/transaction_args_rollup_test.go | 7 +++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 eth/tracers/api_rollup_test.go create mode 100644 internal/ethapi/api_rollup_test.go create mode 100644 internal/ethapi/transaction_args_rollup_test.go diff --git a/core/vm/contracts_rollup.go b/core/vm/contracts_rollup.go index 7de2f59a9e04..d80bcd343782 100644 --- a/core/vm/contracts_rollup.go +++ b/core/vm/contracts_rollup.go @@ -78,7 +78,7 @@ func (c *L1SLoad) Run(input []byte) ([]byte, error) { thereIsAtLeast1StorageKeyToRead := countOfStorageKeysToRead > 0 allStorageKeysAreExactly32Bytes := countOfStorageKeysToRead*common.HashLength == len(input)-common.AddressLength - if inputIsValid := thereIsAtLeast1StorageKeyToRead && allStorageKeysAreExactly32Bytes; !inputIsValid { + if inputIsInvalid := !(thereIsAtLeast1StorageKeyToRead && allStorageKeysAreExactly32Bytes); inputIsInvalid { return nil, errors.New("L1SLOAD input is malformed") } diff --git a/eth/tracers/api_rollup_test.go b/eth/tracers/api_rollup_test.go new file mode 100644 index 000000000000..21581a015aef --- /dev/null +++ b/eth/tracers/api_rollup_test.go @@ -0,0 +1,7 @@ +package tracers + +import "github.com/ethereum/go-ethereum/core/vm" + +func (b *testBackend) GetL1RpcClient() vm.L1RpcClient { + return nil +} diff --git a/internal/ethapi/api_rollup_test.go b/internal/ethapi/api_rollup_test.go new file mode 100644 index 000000000000..337dca43e256 --- /dev/null +++ b/internal/ethapi/api_rollup_test.go @@ -0,0 +1,7 @@ +package ethapi + +import "github.com/ethereum/go-ethereum/core/vm" + +func (b *testBackend) GetL1RpcClient() vm.L1RpcClient { + return nil +} diff --git a/internal/ethapi/transaction_args_rollup_test.go b/internal/ethapi/transaction_args_rollup_test.go new file mode 100644 index 000000000000..5004799d10a9 --- /dev/null +++ b/internal/ethapi/transaction_args_rollup_test.go @@ -0,0 +1,7 @@ +package ethapi + +import "github.com/ethereum/go-ethereum/core/vm" + +func (b *backendMock) GetL1RpcClient() vm.L1RpcClient { + return nil +}