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

fix: v1 retry signature #386

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion chains/evm/calls/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const (
KeyRefreshSig EventSig = "KeyRefresh(string)"
ProposalExecutionSig EventSig = "ProposalExecution(uint8,uint64,bytes32,bytes)"
FeeChangedSig EventSig = "FeeChanged(uint256)"
RetrySig EventSig = "Retry(uint8,uint8,uint256,bytes32)"
RetryV2Sig EventSig = "Retry(uint8,uint8,uint256,bytes32)"
RetryV1Sig EventSig = "Retry(string)"
FeeHandlerChanged EventSig = "FeeHandlerChanged(address)"
)

Expand Down
6 changes: 3 additions & 3 deletions chains/evm/calls/events/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func (l *Listener) parseDeposit(ctx context.Context, dl ethTypes.Log) (*Deposit,
d.SenderAddress = common.BytesToAddress(dl.Topics[1].Bytes())
block, err := l.client.BlockByNumber(ctx, new(big.Int).SetUint64(dl.BlockNumber))
if err == nil {
log.Warn().Msgf("Failed fetching block with number %d because of: %+v", dl.BlockNumber, err)
d.Timestamp = time.Unix(int64(block.Time()), 0)
} else {
log.Warn().Msgf("Failed fetching block with number %d because of: %+v", dl.BlockNumber, err)
d.Timestamp = time.Now()
}

Expand Down Expand Up @@ -119,7 +119,7 @@ func (l *Listener) FetchRetryDepositEvents(event RetryV1Event, bridgeAddress com
}

func (l *Listener) FetchRetryV1Events(ctx context.Context, contractAddress common.Address, startBlock *big.Int, endBlock *big.Int) ([]RetryV1Event, error) {
logs, err := l.client.FetchEventLogs(ctx, contractAddress, string(RetrySig), startBlock, endBlock)
logs, err := l.client.FetchEventLogs(ctx, contractAddress, string(RetryV1Sig), startBlock, endBlock)
if err != nil {
return nil, err
}
Expand All @@ -141,7 +141,7 @@ func (l *Listener) FetchRetryV1Events(ctx context.Context, contractAddress commo
}

func (l *Listener) FetchRetryV2Events(ctx context.Context, contractAddress common.Address, startBlock *big.Int, endBlock *big.Int) ([]RetryV2Event, error) {
logs, err := l.client.FetchEventLogs(ctx, contractAddress, string(RetrySig), startBlock, endBlock)
logs, err := l.client.FetchEventLogs(ctx, contractAddress, string(RetryV2Sig), startBlock, endBlock)
if err != nil {
return nil, err
}
Expand Down
Loading