Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FlacoJones opened this issue Jan 25, 2023 · 0 comments
Open

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

FlacoJones opened this issue Jan 25, 2023 · 0 comments

Comments

@FlacoJones
Copy link
Contributor

FlacoJones commented Jan 25, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant