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

Migration docs uses invalid method in examples #890

Closed
fritzschoff opened this issue Jun 15, 2020 · 3 comments
Closed

Migration docs uses invalid method in examples #890

fritzschoff opened this issue Jun 15, 2020 · 3 comments
Labels
documentation Documentation related issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@fritzschoff
Copy link

https://docs.ethers.io/v5/migration/ethers-v4/#migration-v4--bignumber
Not sure if this is only a mock up, but this encodeData function doesn't exist on the interface class. Tested on v5.2

@ricmoo
Copy link
Member

ricmoo commented Jun 15, 2020

Ah. You’re right. It should be encodeFunctionData.

Because the migration guide mixes v4 and v5 the flatworm automatic code execution is disabled for those sample. I’ll add the feature in the future to flatworm to selectively disable blocks.

I’ll get that fixed today though and get the migration guide a bit more up to snuff for contracts.

edit: typo in the function name

@ricmoo ricmoo added the documentation Documentation related issue. label Jun 15, 2020
@fritzschoff
Copy link
Author

Minor typo in the migration section, it seems like you wanted to use a different function

// v4 (example: Transfer(address indexed, address indexed, uint256)
interface.events.Transfer.encodeTopics(values)
interface.events.Transfer.decode(data, topics)

// v5
interface.encodeFilterTopics("Transfer", values)
interface.encodeEventLog("Transfer", data, topics)

The function you want to call on v5 is decodeEventLog and not encodeEventLog

@ricmoo ricmoo added the on-deck This Enhancement or Bug is currently being worked on. label Jul 5, 2020
ricmoo added a commit that referenced this issue Jul 5, 2020
@ricmoo
Copy link
Member

ricmoo commented Jul 5, 2020

I've updated the docs and published them.

Thanks! :)

@ricmoo ricmoo closed this as completed Jul 5, 2020
@ricmoo ricmoo changed the title Migraction docs uses invalid method Migration docs uses invalid method in examples Jul 19, 2020
@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation related issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants