Closed lucasmenendez closed 9 months ago
CodeRabbit
This update enhances the SetRef
function across ERC20, ERC721, and ERC777 providers to set the creation block when it's greater than 0. It also refines the HoldersBalances
function to handle outdated last network blocks and introduces error handling for this scenario. Additionally, the Web3ProviderRef
struct and ScannerToken
have been updated with a new CreationBlock
field.
Files | Summary |
---|---|
scanner/providers/web3/erc20_provider.go, scanner/providers/web3/erc721_provider.go, scanner/providers/web3/erc777_provider.go | Improved SetRef function to set the creation block if it's greater than 0. Updated HoldersBalances function to handle cases where the last network block is outdated and added error return for this scenario. |
scanner/providers/web3/web3_provider.go, scanner/scanner.go | Added CreationBlock field to Web3ProviderRef struct and ScannerToken . Updated struct fields and assignments accordingly. Adjusted function signatures for consistency. |
🐰 "In the land of code, changes are afoot,
With each pull request, we give bugs the boot.
From ERCs to Web3, in every provider's den,
We refine and enhance, again and again.
So here's to the updates, may they never cease,
In the quest for perfection, and coding peace." 🎉
Uplevel your code reviews with CodeRabbit Pro
### CodeRabbit Pro If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.
LGTM
Now the web3 holder providers check if the last scanned block is the same that the creation block, and both are greater than the last network block (cached), and return and error to prevent false synced statuses.
Tokens with a creation block newer than the last cached network block will be scanned when the last block is updated.
Summary by CodeRabbit
SetRef
function across ERC20, ERC721, and ERC777 providers to correctly set the creation block when it's greater than 0.HoldersBalances
function to handle outdated last network blocks and added error handling for these scenarios.Refactor: Updated the
Web3ProviderRef
struct andScannerToken
in web3_provider.go and scanner.go files respectively, with a newCreationBlock
field for better data organization.