Skip to content

Commit 8afadc4

Browse files
authored
Merge pull request #399 from alephium/fix-multicall
Fix multicall
2 parents 98359ac + 6d9c423 commit 8afadc4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/web3/src/contract/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ export async function multicallMethods<I extends ContractInstance, F extends Fie
19401940
const callsResult: Record<string, CallContractResult<any>> = {}
19411941
callsParams.forEach((call, index) => {
19421942
const methodIndex = call.methodIndex
1943-
const callResult = result.results[`${methodIndex}`]
1943+
const callResult = result.results[`${index}`]
19441944
const methodName = callEntries[`${index}`][`0`]
19451945
callsResult[`${methodName}`] = contract.contract.fromApiCallContractResult(
19461946
callResult,

test/token.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ describe('contract', function () {
7777
it('should multicall', async () => {
7878
const tokenTest = (await TokenTest.deploy(signer, { initialFields })).contractInstance
7979
const result = await tokenTest.multicall({
80-
getSymbol: {},
8180
getName: {},
81+
getTotalSupply: {},
8282
getDecimals: {},
83-
getTotalSupply: {}
83+
getSymbol: {}
8484
})
8585
expect(result.getSymbol.returns).toEqual(symbol)
8686
expect(result.getName.returns).toEqual(name)

0 commit comments

Comments
 (0)