rename method to eth_simulateV1

This commit is contained in:
Sina Mahmoodi 2024-01-11 14:35:09 +03:30
parent 589107b6f5
commit 89df0e3b2c
4 changed files with 6 additions and 6 deletions

View file

@ -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 {

View file

@ -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)

View file

@ -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],
}),