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

feat: improved contract receipt related logic #1548

Merged
merged 8 commits into from
Jul 19, 2023

Conversation

antazoey
Copy link
Member

What I did

Please review + merge #1547 first! this PR depends on those changes so it has all the same changes but i will rebase after and the diff will look nicer. I am leaving it in draft until that is done

  • Adds chain.get_contract_receipt() method to help get receipts for contracts.
  • Changes receipt on ContractInstance to no longer be optional. If it does not have it, it will call the new method to get it.
  • fixes: Fetching all contract events searches through a lot of useless history #1062 Changes the default start_block to use the start block of the contract's receipt when not given for event queries

How I did it

@fubuloubu wrote the start of the algo, i fixed the bug in it, pasted in it, made mypy happy, added some tests, wired it up in some places that make it work nicely in the bg.

How to verify it

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@vany365 vany365 changed the title feat: improved contract receipt related logic [] feat: improved contract receipt related logic [] [APE-1204] Jul 18, 2023
@antazoey antazoey changed the title feat: improved contract receipt related logic [] [APE-1204] feat: improved contract receipt related logic Jul 18, 2023
src/ape/contracts/base.py Outdated Show resolved Hide resolved
src/ape/managers/chain.py Outdated Show resolved Hide resolved
@antazoey antazoey marked this pull request as ready for review July 18, 2023 22:30
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

Successfully merging this pull request may close these issues.

Fetching all contract events searches through a lot of useless history
2 participants