mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Bound the filter of init SC events by blocks
When querying the init event for each smart contract, bound the search from block genesis-24h to block genesis. Otherwise, this query in geth synced to mainnet takes too long.
This commit is contained in:
@@ -1152,7 +1152,7 @@ func (c *Client) RollupEventsByBlock(blockNum int64,
|
||||
}
|
||||
|
||||
// RollupEventInit returns the initialize event with its corresponding block number
|
||||
func (c *Client) RollupEventInit() (*eth.RollupEventInitialize, int64, error) {
|
||||
func (c *Client) RollupEventInit(genesisBlockNum int64) (*eth.RollupEventInitialize, int64, error) {
|
||||
vars := c.blocks[0].Rollup.Vars
|
||||
return ð.RollupEventInitialize{
|
||||
ForgeL1L2BatchTimeout: uint8(vars.ForgeL1L2BatchTimeout),
|
||||
@@ -1628,7 +1628,7 @@ func (c *Client) AuctionEventsByBlock(blockNum int64,
|
||||
}
|
||||
|
||||
// AuctionEventInit returns the initialize event with its corresponding block number
|
||||
func (c *Client) AuctionEventInit() (*eth.AuctionEventInitialize, int64, error) {
|
||||
func (c *Client) AuctionEventInit(genesisBlockNum int64) (*eth.AuctionEventInitialize, int64, error) {
|
||||
vars := c.blocks[0].Auction.Vars
|
||||
return ð.AuctionEventInitialize{
|
||||
DonationAddress: vars.DonationAddress,
|
||||
@@ -1863,7 +1863,7 @@ func (c *Client) WDelayerConstants() (*common.WDelayerConstants, error) {
|
||||
}
|
||||
|
||||
// WDelayerEventInit returns the initialize event with its corresponding block number
|
||||
func (c *Client) WDelayerEventInit() (*eth.WDelayerEventInitialize, int64, error) {
|
||||
func (c *Client) WDelayerEventInit(genesisBlockNum int64) (*eth.WDelayerEventInitialize, int64, error) {
|
||||
vars := c.blocks[0].WDelayer.Vars
|
||||
return ð.WDelayerEventInitialize{
|
||||
InitialWithdrawalDelay: vars.WithdrawalDelay,
|
||||
|
||||
Reference in New Issue
Block a user