Skip to content

Can't ethereum.decode data output by ethers.AbiCoder.encode #13

@FlacoJones

Description

@FlacoJones

The problem:

When I run something like this

I get a non-tupled output of data.

In order to decode, and then index into the parameters of the data in the Graph, like here

So, the challenge is essentially to figure out when and how to achieve this consistently in:

Such that we are testing and expecting correctly

Resources:

Our frequently used tuple prefixing: https://github.com/OpenQDev/OpenQ-Graph/blob/a6dcf72e5e1191ad45b8ca1b68df897f56294a17/src/utils.ts

Enzyme finance tuple prefixing: https://github.com/enzymefinance/enzyme-subgraph/blob/69a2c2a11ca7fe77431656e0e6df26274e81d356/packages/utils/utils/decode.ts#L5

Other people doing the same stupid tuple prefixing: https://github.com/enzymefinance/enzyme-subgraph/blob/69a2c2a11ca7fe77431656e0e6df26274e81d356/subgraphs/enzyme-core/mappings/v4/ExternalPositionManager.ts#L160

An old example: https://github.com/graphprotocol/graph-node/blob/6a7806cc465949ebb9e5b8269eeb763857797efc/tests/integration-tests/host-exports/src/mapping.ts#L72

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions