Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat(etherscan): Add get_block_by_timestamp to ethers-etherscan #2349

Merged

Conversation

0xrainbowtrout
Copy link
Contributor

@0xrainbowtrout 0xrainbowtrout commented Apr 14, 2023

Motivation

The Etherscan API has a blocks endpoint with a variety of useful methods. This PR incorporates the get-block-number-by-timestamp endpoint. I need to be able to fetch blocks by timestamps to evaluate blockchain state by timestamp and this seems like the best home for that functionality given the ethers-etherscan module.

Solution

Add the API endpoint.

PR Checklist

  • Added Tests
  • Added Documentation
  • [ ] Breaking changes (No breaking changes)

@0xrainbowtrout 0xrainbowtrout changed the title ENH: Add get_block_by_timestamp to ethers-etherscan feat(etherscan): Add get_block_by_timestamp to ethers-etherscan Apr 14, 2023
@0xrainbowtrout
Copy link
Contributor Author

Just a ping here -- No rush but didn't want it to fall off if you hadn't seen it.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

ethers-etherscan/src/blocks.rs Outdated Show resolved Hide resolved
ethers-etherscan/src/blocks.rs Outdated Show resolved Hide resolved
@0xrainbowtrout
Copy link
Contributor Author

Fixed formatting from the failed clippy/fmt workflows.

Copy link
Collaborator

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@DaniPopes DaniPopes merged commit 18f10e6 into gakonst:master May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants