Skip to content

Commit

Permalink
chg: fix LatestBlockNumber case
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Nov 13, 2024
1 parent 57e6560 commit 8b52903
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helper/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ func (c *ContractCaller) GetMaticChainBlock(blockNum *big.Int) (header *ethTypes

if c.MaticGrpcFlag {
if blockNum == nil {
latestBlock, err = c.MaticGrpcClient.HeaderByNumber(ctx, uint64(rpc.LatestBlockNumber.Int64()))
// LatestBlockNumber is BlockNumber(-2) in go-ethereum rpc
latestBlock, err = c.MaticGrpcClient.HeaderByNumber(ctx, -2)

Check failure on line 470 in helper/call.go

View workflow job for this annotation

GitHub Actions / build

cannot use -2 (untyped int constant) as uint64 value in argument to c.MaticGrpcClient.HeaderByNumber (overflows)

Check failure on line 470 in helper/call.go

View workflow job for this annotation

GitHub Actions / lint

cannot use -2 (untyped int constant) as uint64 value in argument to c.MaticGrpcClient.HeaderByNumber (overflows)) (typecheck)

Check failure on line 470 in helper/call.go

View workflow job for this annotation

GitHub Actions / lint

cannot use -2 (untyped int constant) as uint64 value in argument to c.MaticGrpcClient.HeaderByNumber (overflows)) (typecheck)

Check failure on line 470 in helper/call.go

View workflow job for this annotation

GitHub Actions / lint

cannot use -2 (untyped int constant) as uint64 value in argument to c.MaticGrpcClient.HeaderByNumber (overflows)) (typecheck)

Check failure on line 470 in helper/call.go

View workflow job for this annotation

GitHub Actions / lint

cannot use -2 (untyped int constant) as uint64 value in argument to c.MaticGrpcClient.HeaderByNumber (overflows)) (typecheck)

Check failure on line 470 in helper/call.go

View workflow job for this annotation

GitHub Actions / lint

cannot use -2 (untyped int constant) as uint64 value in argument to c.MaticGrpcClient.HeaderByNumber (overflows)) (typecheck)

Check failure on line 470 in helper/call.go

View workflow job for this annotation

GitHub Actions / test

cannot use -2 (untyped int constant) as uint64 value in argument to c.MaticGrpcClient.HeaderByNumber (overflows)
} else {
latestBlock, err = c.MaticGrpcClient.HeaderByNumber(ctx, blockNum.Uint64())
}
Expand Down

0 comments on commit 8b52903

Please sign in to comment.