mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
rename to multicallV1
This commit is contained in:
parent
04965a36a0
commit
c78330d32c
3 changed files with 5 additions and 5 deletions
|
|
@ -1127,7 +1127,7 @@ func (r *callResult) MarshalJSON() ([]byte, error) {
|
||||||
//
|
//
|
||||||
// Note, this function doesn't make any changes in the state/blockchain and is
|
// Note, this function doesn't make any changes in the state/blockchain and is
|
||||||
// useful to execute and retrieve values.
|
// useful to execute and retrieve values.
|
||||||
func (s *BlockChainAPI) Multicall(ctx context.Context, blocks []CallBatch, blockNrOrHash rpc.BlockNumberOrHash, includeTransfers *bool) ([][]callResult, error) {
|
func (s *BlockChainAPI) MulticallV1(ctx context.Context, blocks []CallBatch, blockNrOrHash rpc.BlockNumberOrHash, includeTransfers *bool) ([][]callResult, error) {
|
||||||
state, header, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)
|
state, header, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)
|
||||||
if state == nil || err != nil {
|
if state == nil || err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -598,7 +598,7 @@ func TestCall(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMulticall(t *testing.T) {
|
func TestMulticallV1(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Initialize test accounts
|
// Initialize test accounts
|
||||||
var (
|
var (
|
||||||
|
|
@ -982,7 +982,7 @@ func TestMulticall(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, tc := range testSuite {
|
for i, tc := range testSuite {
|
||||||
result, err := api.Multicall(context.Background(), tc.blocks, tc.tag, tc.includeTransfers)
|
result, err := api.MulticallV1(context.Background(), tc.blocks, tc.tag, tc.includeTransfers)
|
||||||
if tc.expectErr != nil {
|
if tc.expectErr != nil {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("test %d: want error %v, have nothing", i, tc.expectErr)
|
t.Errorf("test %d: want error %v, have nothing", i, tc.expectErr)
|
||||||
|
|
|
||||||
|
|
@ -612,8 +612,8 @@ web3._extend({
|
||||||
inputFormatter: [web3._extend.formatters.inputCallFormatter, web3._extend.formatters.inputDefaultBlockNumberFormatter, null, null],
|
inputFormatter: [web3._extend.formatters.inputCallFormatter, web3._extend.formatters.inputDefaultBlockNumberFormatter, null, null],
|
||||||
}),
|
}),
|
||||||
new web3._extend.Method({
|
new web3._extend.Method({
|
||||||
name: 'multicall',
|
name: 'multicallV1',
|
||||||
call: 'eth_multicall',
|
call: 'eth_multicallV1',
|
||||||
params: 3,
|
params: 3,
|
||||||
inputFormatter: [null, web3._extend.formatters.inputDefaultBlockNumberFormatter, null],
|
inputFormatter: [null, web3._extend.formatters.inputDefaultBlockNumberFormatter, null],
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue