Skip to content

Commit 897d073

Browse files
committed
fix: copilot comments
1 parent 42a101d commit 897d073

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

etherman/config/network_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
// Test for issue: 1389
1919
func TestEthClientExploratory(t *testing.T) {
20-
t.Skip("explotaroty test")
20+
t.Skip("exploratory test")
2121
l2url := os.Getenv("L2URL")
2222
ethRawClient, err := ethclient.Dial(l2url)
2323
require.NoError(t, err)

etherman/default_eth_client.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,11 @@ func (c *DefaultEthClient) resolveBlockNumber(ctx context.Context,
9393
return nil, err
9494
}
9595
num := number.CalculateBlockNumber(hdr.Number)
96-
return big.NewInt(int64(num)), nil
96+
return big.NewInt(0).SetUint64(num), nil
9797
}
9898

9999
func (c *DefaultEthClient) rpcGetBlockByNumber(ctx context.Context, number *big.Int) (*aggkittypes.BlockHeader, error) {
100100
blockArg := rpc.BlockNumber(number.Int64()).String()
101-
fmt.Printf("rpcGetBlockByNumber: requesting block %s via JSON RPC\n", blockArg)
102101
var rawEthHeader *blockRawEth
103102
err := c.CallContext(ctx, &rawEthHeader, "eth_getBlockByNumber", blockArg, false)
104103
if err != nil {

multidownloader/evm_multidownloader_syncers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (dh *EVMMultidownloader) HeaderByNumber(ctx context.Context,
7474
dh.log.Debugf("EVMMultidownloader.HeaderByNumber: received number: %s", number.String())
7575
defer dh.log.Debugf("EVMMultidownloader.HeaderByNumber: finished number: %s", number.String())
7676
if !number.IsConstant() {
77-
return nil, fmt.Errorf("EVMMultidownloader.HeaderByNumber: only numeric blockNumber are not supported=%s",
77+
return nil, fmt.Errorf("EVMMultidownloader.HeaderByNumber: only numeric blockNumbers are supported (got=%s)",
7878
number.String())
7979
}
8080
blockNumber := number.Specific

multidownloader/types/syncer_config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"sort"
55

66
aggkitcommon "github.com/agglayer/aggkit/common"
7+
"github.com/agglayer/aggkit/log"
78
aggkittypes "github.com/agglayer/aggkit/types"
89
"github.com/ethereum/go-ethereum/common"
910
)
@@ -37,6 +38,7 @@ func (c *ContractConfig) Update(syncerConfig aggkittypes.SyncerConfig) {
3738
lessFinal, err := syncerConfig.ToBlock.LessFinalThan(c.ToBlock)
3839
if err != nil {
3940
// In case of error, we do not update ToBlock
41+
log.Warnf("ContractConfig.Update: cannot compare ToBlock finality: %v", err)
4042
return
4143
}
4244
if lessFinal {

types/block_finality.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func (b *BlockNumberFinality) ToBigInt() *big.Int {
236236
return nil
237237
}
238238
if b.Block.IsConstant() {
239-
return big.NewInt(int64(b.Specific))
239+
return big.NewInt(0).SetUint64(b.Specific)
240240
}
241241
return b.Block.ToBigInt()
242242
}
@@ -311,7 +311,7 @@ func (b *BlockNumberFinality) LessFinalThan(other BlockNumberFinality) (bool, er
311311
return b.Specific < other.Specific, nil
312312
}
313313
if b.Block.IsConstant() || other.Block.IsConstant() {
314-
return true, fmt.Errorf("cannot compare constant block with non-constant block")
314+
return false, fmt.Errorf("cannot compare constant block with non-constant block")
315315
}
316316
if b == nil {
317317
return true, nil

0 commit comments

Comments
 (0)