Skip to content

Commit

Permalink
Fix toEthereumValue method when used with ethereum.decode
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed May 12, 2023
1 parent 0cef700 commit 2aefcb9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/util/src/graph/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,14 @@ export const toEthereumValue = async (instanceExports: any, output: utils.ParamT
// Get values for struct elements.
const ethereumValuePromises = output.components
.map(
async (component: utils.ParamType) => toEthereumValue(
async (component: utils.ParamType, index: number) => toEthereumValue(
instanceExports,
component,
value[component.name]
// Event data passed from watcher is not an array
// When method is used for ethereum.decode component.name can be null
// TODO: Pass event data as ethers.js Result interface
// https://docs.ethers.org/v5/api/utils/abi/interface/#Result
value[component.name] ?? value[index]
)
);

Expand Down

0 comments on commit 2aefcb9

Please sign in to comment.