Skip to content

Commit

Permalink
Address PR comments [1]
Browse files Browse the repository at this point in the history
  • Loading branch information
swift1337 committed Jul 8, 2024
1 parent 1d74153 commit 358d971
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions zetaclient/chains/evm/observer/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,19 @@ func (ob *Observer) ObserveInbound(ctx context.Context, sampledLogger zerolog.Lo
startBlock, toBlock := ob.calcBlockRangeToScan(confirmedBlockNum, lastScanned, config.MaxBlocksPerPeriod)

// task 1: query evm chain for zeta sent logs (read at most 100 blocks in one go)
lastScannedZetaSent, _ := ob.ObserveZetaSent(ctx, startBlock, toBlock)
lastScannedZetaSent, err := ob.ObserveZetaSent(ctx, startBlock, toBlock)
if err != nil {
return errors.Wrap(err, "unable to observe ZetaSent")

Check warning on line 208 in zetaclient/chains/evm/observer/inbound.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/chains/evm/observer/inbound.go#L206-L208

Added lines #L206 - L208 were not covered by tests
}

// task 2: query evm chain for deposited logs (read at most 100 blocks in one go)
lastScannedDeposited := ob.ObserveERC20Deposited(ctx, startBlock, toBlock)

Check warning on line 212 in zetaclient/chains/evm/observer/inbound.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/chains/evm/observer/inbound.go#L212

Added line #L212 was not covered by tests

// task 3: query the incoming tx to TSS address (read at most 100 blocks in one go)
lastScannedTssRecvd, _ := ob.ObserverTSSReceive(ctx, startBlock, toBlock)
lastScannedTssRecvd, err := ob.ObserverTSSReceive(ctx, startBlock, toBlock)
if err != nil {
return errors.Wrap(err, "unable to observe TSSReceive")

Check warning on line 217 in zetaclient/chains/evm/observer/inbound.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/chains/evm/observer/inbound.go#L215-L217

Added lines #L215 - L217 were not covered by tests
}

// note: using lowest height for all 3 events is not perfect, but it's simple and good enough
lastScannedLowest := lastScannedZetaSent
Expand Down

0 comments on commit 358d971

Please sign in to comment.