diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 92d56f663b..6bc5babc71 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1233,14 +1233,14 @@ func (s *BlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockNrO return result.Return(), result.Err } -// MulticallV1 executes series of transactions on top of a base state. +// SimulateV1 executes series of transactions on top of a base state. // The transactions are packed into blocks. For each block, block header // fields can be overridden. The state can also be overridden prior to // execution of each block. // // Note, this function doesn't make any changes in the state/blockchain and is // useful to execute and retrieve values. -func (s *BlockChainAPI) MulticallV1(ctx context.Context, opts mcOpts, blockNrOrHash *rpc.BlockNumberOrHash) ([]mcBlockResult, error) { +func (s *BlockChainAPI) SimulateV1(ctx context.Context, opts mcOpts, blockNrOrHash *rpc.BlockNumberOrHash) ([]mcBlockResult, error) { if len(opts.BlockStateCalls) == 0 { return nil, &invalidParamsError{message: "empty input"} } else if len(opts.BlockStateCalls) > maxMulticallBlocks { diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index 707f10a62c..ea012465fa 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -946,7 +946,7 @@ func TestCall(t *testing.T) { } } -func TestMulticallV1(t *testing.T) { +func TestSimulateV1(t *testing.T) { t.Parallel() // Initialize test accounts var ( @@ -1794,7 +1794,7 @@ func TestMulticallV1(t *testing.T) { if tc.validation != nil && *tc.validation { opts.Validation = true } - result, err := api.MulticallV1(context.Background(), opts, &tc.tag) + result, err := api.SimulateV1(context.Background(), opts, &tc.tag) if tc.expectErr != nil { if err == nil { t.Fatalf("test %s: want error %v, have nothing", tc.name, tc.expectErr) diff --git a/internal/ethapi/multicall.go b/internal/ethapi/simulate.go similarity index 100% rename from internal/ethapi/multicall.go rename to internal/ethapi/simulate.go diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index 7ee01fce9a..76b71989e3 100644 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -618,8 +618,8 @@ web3._extend({ inputFormatter: [web3._extend.formatters.inputCallFormatter, web3._extend.formatters.inputDefaultBlockNumberFormatter, null, null], }), new web3._extend.Method({ - name: 'multicallV1', - call: 'eth_multicallV1', + name: 'simulateV1', + call: 'eth_simulateV1', params: 3, inputFormatter: [null, web3._extend.formatters.inputDefaultBlockNumberFormatter, null], }),