Skip to content

Commit

Permalink
Merge pull request #399 from alephium/fix-multicall
Browse files Browse the repository at this point in the history
Fix multicall
  • Loading branch information
polarker authored Jul 18, 2024
2 parents 98359ac + 6d9c423 commit 8afadc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/web3/src/contract/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ export async function multicallMethods<I extends ContractInstance, F extends Fie
const callsResult: Record<string, CallContractResult<any>> = {}
callsParams.forEach((call, index) => {
const methodIndex = call.methodIndex
const callResult = result.results[`${methodIndex}`]
const callResult = result.results[`${index}`]
const methodName = callEntries[`${index}`][`0`]
callsResult[`${methodName}`] = contract.contract.fromApiCallContractResult(
callResult,
Expand Down
4 changes: 2 additions & 2 deletions test/token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ describe('contract', function () {
it('should multicall', async () => {
const tokenTest = (await TokenTest.deploy(signer, { initialFields })).contractInstance
const result = await tokenTest.multicall({
getSymbol: {},
getName: {},
getTotalSupply: {},
getDecimals: {},
getTotalSupply: {}
getSymbol: {}
})
expect(result.getSymbol.returns).toEqual(symbol)
expect(result.getName.returns).toEqual(name)
Expand Down

0 comments on commit 8afadc4

Please sign in to comment.