Skip to content

Commit

Permalink
golangci-lint: add unconvert (#11757)
Browse files Browse the repository at this point in the history
* golangci-lint: add unconvert

* unconvert
  • Loading branch information
jmank88 authored Jan 12, 2024
1 parent c0f9838 commit e595f5b
Show file tree
Hide file tree
Showing 58 changed files with 155 additions and 154 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ linters:
- misspell
- rowserrcheck
- errorlint
- unconvert
- sqlclosecheck
- noctx
linters-settings:
Expand Down
2 changes: 1 addition & 1 deletion common/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Reset(addr
// - marks all pending and inflight transactions fatally errored (note: at this point all transactions are either confirmed or fatally errored)
// this must not be run while Broadcaster or Confirmer are running
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) abandon(addr ADDR) (err error) {
ctx, cancel := services.StopChan(b.chStop).NewCtx()
ctx, cancel := b.chStop.NewCtx()
defer cancel()
if err = b.txStore.Abandon(ctx, b.chainID, addr); err != nil {
return fmt.Errorf("abandon failed to update txes for key %s: %w", addr.String(), err)
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/client/node_lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) {
return
})

iN := NewNode(cfg, time.Duration(time.Second), logger.Test(t), *s.WSURL(), nil, "test node", 42, testutils.FixtureChainID, 1)
iN := NewNode(cfg, time.Second, logger.Test(t), *s.WSURL(), nil, "test node", 42, testutils.FixtureChainID, 1)
n := iN.(*node)

dial(t, n)
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestChainScopedConfig(t *testing.T) {
ChainID: id,
Chain: toml.Defaults(id, &toml.Chain{
GasEstimator: toml.GasEstimator{
BumpTxDepth: ptr(uint32(override)),
BumpTxDepth: ptr(override),
},
}),
}
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/config/toml/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func (c *Chain) ValidateConfig() (err error) {
Msg: config.ErrInvalidChainType.Error()})
}

if c.GasEstimator.BumpTxDepth != nil && uint32(*c.GasEstimator.BumpTxDepth) > *c.Transactions.MaxInFlight {
if c.GasEstimator.BumpTxDepth != nil && *c.GasEstimator.BumpTxDepth > *c.Transactions.MaxInFlight {
err = multierr.Append(err, commonconfig.ErrInvalid{Name: "GasEstimator.BumpTxDepth", Value: *c.GasEstimator.BumpTxDepth,
Msg: "must be less than or equal to Transactions.MaxInFlight"})
}
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/forwarders/forwarder_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (f *FwdMgr) runLoop() {
defer f.wg.Done()
tick := time.After(0)

for ; ; tick = time.After(utils.WithJitter(time.Duration(time.Minute))) {
for ; ; tick = time.After(utils.WithJitter(time.Minute)) {
select {
case <-tick:
if err := f.logpoller.Ready(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/log/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ func (b *broadcaster) onNewHeads() {

b.lastSeenHeadNumber.Store(latestHead.Number)

keptLogsDepth := uint32(b.config.FinalityDepth())
keptLogsDepth := b.config.FinalityDepth()
if b.registrations.highestNumConfirmations > keptLogsDepth {
keptLogsDepth = b.registrations.highestNumConfirmations
}
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/log/eth_subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (sub *ethSubscriber) backfillLogs(fromBlockOverride null.Int64, addresses [
return true
}

sub.logger.Infow(fmt.Sprintf("LogBroadcaster: Fetched a batch of %v logs from %v to %v%s", len(batchLogs), from, to, elapsedMessage), "len", len(batchLogs), "fromBlock", from, "toBlock", to, "remaining", int64(latestHeight)-to)
sub.logger.Infow(fmt.Sprintf("LogBroadcaster: Fetched a batch of %v logs from %v to %v%s", len(batchLogs), from, to, elapsedMessage), "len", len(batchLogs), "fromBlock", from, "toBlock", to, "remaining", latestHeight-to)

select {
case <-sub.chStop:
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/logpoller/log_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ func (lp *logPoller) GetBlocksRange(ctx context.Context, numbers []uint64, qopts
qopts = append(qopts, pg.WithParentCtx(ctx))
minRequestedBlock := int64(mathutil.Min(numbers[0], numbers[1:]...))
maxRequestedBlock := int64(mathutil.Max(numbers[0], numbers[1:]...))
lpBlocks, err := lp.orm.GetBlocksRange(int64(minRequestedBlock), int64(maxRequestedBlock), qopts...)
lpBlocks, err := lp.orm.GetBlocksRange(minRequestedBlock, maxRequestedBlock, qopts...)
if err != nil {
lp.lggr.Warnw("Error while retrieving blocks from log pollers blocks table. Falling back to RPC...", "requestedBlocks", numbers, "err", err)
} else {
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/txmgr/attempts.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (c *evmTxAttemptBuilder) NewEmptyTxAttempt(nonce evmtypes.Nonce, feeLimit u
uint64(nonce),
fromAddress,
value,
uint32(feeLimit),
feeLimit,
fee.Legacy,
payload,
)
Expand Down
6 changes: 3 additions & 3 deletions core/chains/evm/txmgr/attempts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ func TestTxm_NewDynamicFeeTx(t *testing.T) {
{"gas tip < fee cap", assets.GWei(4), assets.GWei(5), nil, ""},
{"gas tip > fee cap", assets.GWei(6), assets.GWei(5), nil, "gas fee cap must be greater than or equal to gas tip cap (fee cap: 5 gwei, tip cap: 6 gwei)"},
{"fee cap exceeds max allowed", assets.GWei(5), assets.GWei(5), func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].GasEstimator.PriceMax = (*assets.Wei)(assets.GWei(4))
c.EVM[0].GasEstimator.PriceMax = assets.GWei(4)
}, "specified gas fee cap of 5 gwei would exceed max configured gas price of 4 gwei"},
{"ignores global min gas price", assets.GWei(5), assets.GWei(5), func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].GasEstimator.PriceMin = (*assets.Wei)(assets.GWei(6))
c.EVM[0].GasEstimator.PriceMin = assets.GWei(6)
}, ""},
{"tip cap below min allowed", assets.GWei(5), assets.GWei(5), func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].GasEstimator.TipCapMin = (*assets.Wei)(assets.GWei(6))
c.EVM[0].GasEstimator.TipCapMin = assets.GWei(6)
}, "specified gas tip cap of 5 gwei is below min configured gas tip of 6 gwei"},
}

Expand Down
18 changes: 9 additions & 9 deletions core/chains/evm/txmgr/broadcaster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
}, evmcfg.EVM().GasEstimator().EIP1559DynamicFees(), nil)
txBuilder := txmgr.NewEvmTxAttemptBuilder(*ethClient.ConfiguredChainID(), evmcfg.EVM().GasEstimator(), ethKeyStore, estimator)
localNextNonce = getLocalNextNonce(t, eb, fromAddress)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(localNextNonce), nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce, nil).Once()
eb2 := txmgr.NewEvmBroadcaster(txStore, txmgr.NewEvmTxmClient(ethClient), txmgr.NewEvmTxmConfig(evmcfg.EVM()), txmgr.NewEvmTxmFeeConfig(evmcfg.EVM().GasEstimator()), evmcfg.EVM().Transactions(), evmcfg.Database().Listener(), ethKeyStore, txBuilder, nil, lggr, &testCheckerFactory{}, false)
retryable, err := eb2.ProcessUnstartedTxs(ctx, fromAddress)
assert.NoError(t, err)
Expand Down Expand Up @@ -1193,7 +1193,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
require.Equal(t, int64(localNextNonce), int64(nonce))

// On the second try, the tx has been accepted into the mempool
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(localNextNonce+1), nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce+1, nil).Once()

retryable, err = eb.ProcessUnstartedTxs(ctx, fromAddress)
assert.NoError(t, err)
Expand All @@ -1217,10 +1217,10 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
localNextNonce := getLocalNextNonce(t, eb, fromAddress)
etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, &cltest.FixtureChainID)
ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool {
return tx.Nonce() == uint64(localNextNonce)
return tx.Nonce() == localNextNonce
}), fromAddress).Return(commonclient.Unknown, errors.New(retryableErrorExample)).Once()
// Nonce is the same as localNextNonce, implying that this sent transaction has not been accepted
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(localNextNonce), nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce, nil).Once()

// Do the thing
retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress)
Expand Down Expand Up @@ -1269,7 +1269,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
localNextNonce := getLocalNextNonce(t, eb, fromAddress)
etx := mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, &cltest.FixtureChainID)
ethClient.On("SendTransactionReturnCode", mock.Anything, mock.MatchedBy(func(tx *gethTypes.Transaction) bool {
return tx.Nonce() == uint64(localNextNonce)
return tx.Nonce() == localNextNonce
}), fromAddress).Return(commonclient.Unknown, errors.New(retryableErrorExample)).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), errors.New("pending nonce fetch failed")).Once()

Expand Down Expand Up @@ -1324,7 +1324,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
return tx.Nonce() == localNextNonce
}), fromAddress).Return(commonclient.Unknown, errors.New(retryableErrorExample)).Once()
// Nonce is one higher than localNextNonce, implying that despite the error, this sent transaction has been accepted into the mempool
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(localNextNonce+1), nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce+1, nil).Once()

// Do the thing
retryable, err := eb.ProcessUnstartedTxs(ctx, fromAddress)
Expand Down Expand Up @@ -1466,7 +1466,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
c.EVM[0].GasEstimator.BumpMin = assets.NewWeiI(0)
c.EVM[0].GasEstimator.BumpPercent = ptr[uint16](0)
}))
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(localNextNonce), nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce, nil).Once()
eb2 := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, evmcfg2, &testCheckerFactory{}, false)
mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, &cltest.FixtureChainID)

Expand Down Expand Up @@ -1558,7 +1558,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Errors(t *testing.T) {
c.EVM[0].GasEstimator.BumpPercent = ptr[uint16](0)
}))
localNextNonce := getLocalNextNonce(t, eb, fromAddress)
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(localNextNonce), nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(localNextNonce, nil).Once()
eb2 := NewTestEthBroadcaster(t, txStore, ethClient, ethKeyStore, evmcfg2, &testCheckerFactory{}, false)
mustCreateUnstartedTx(t, txStore, fromAddress, toAddress, encodedPayload, gasLimit, value, &cltest.FixtureChainID)
underpricedError := "transaction underpriced"
Expand Down Expand Up @@ -1799,7 +1799,7 @@ func TestEthBroadcaster_SyncNonce(t *testing.T) {
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(0), nil).Once()
eb := txmgr.NewEvmBroadcaster(txStore, txmgr.NewEvmTxmClient(ethClient), evmTxmCfg, txmgr.NewEvmTxmFeeConfig(ge), evmcfg.EVM().Transactions(), cfg.Database().Listener(), kst, txBuilder, txNonceSyncer, lggr, checkerFactory, true)

ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(uint64(ethNodeNonce), nil).Once()
ethClient.On("PendingNonceAt", mock.Anything, fromAddress).Return(ethNodeNonce, nil).Once()
servicetest.Run(t, eb)

testutils.WaitForLogMessage(t, observed, "Fast-forward sequence")
Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/txmgr/confirmer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary(t *testing.T) {

db := pgtest.NewSqlxDB(t)
cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].GasEstimator.PriceMax = (*assets.Wei)(assets.GWei(500))
c.EVM[0].GasEstimator.PriceMax = assets.GWei(500)
})
txStore := cltest.NewTestTxStore(t, db, cfg.Database())

Expand Down Expand Up @@ -2373,7 +2373,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyUnderpriced_ThenGoesTh

db := pgtest.NewSqlxDB(t)
cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.EVM[0].GasEstimator.PriceMax = (*assets.Wei)(assets.GWei(500))
c.EVM[0].GasEstimator.PriceMax = assets.GWei(500)
})
txStore := cltest.NewTestTxStore(t, db, cfg.Database())

Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/txmgr/evm_tx_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func fromDBReceiptsPlus(rs []dbReceiptPlus) []ReceiptPlus {
func toOnchainReceipt(rs []*evmtypes.Receipt) []rawOnchainReceipt {
receipts := make([]rawOnchainReceipt, len(rs))
for i := 0; i < len(rs); i++ {
receipts[i] = rawOnchainReceipt(*rs[i])
receipts[i] = *rs[i]
}
return receipts
}
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/types/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (h *Head) MarshalJSON() ([]byte, error) {
if h.StateRoot != (common.Hash{}) {
jsonHead.StateRoot = &h.StateRoot
}
jsonHead.Number = (*hexutil.Big)(big.NewInt(int64(h.Number)))
jsonHead.Number = (*hexutil.Big)(big.NewInt(h.Number))
if h.ParentHash != (common.Hash{}) {
jsonHead.ParentHash = &h.ParentHash
}
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/types/nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ func (n Nonce) String() string {
}

func GenerateNextNonce(prev Nonce) Nonce {
return Nonce(prev + 1)
return prev + 1
}
12 changes: 6 additions & 6 deletions core/internal/features/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,8 @@ observationSource = """
cltest.AwaitJobActive(t, app.JobSpawner(), j.ID, testutils.WaitTimeout(t))

run := cltest.CreateJobRunViaUser(t, app, j.ExternalJobID, "")
assert.Equal(t, []*string([]*string(nil)), run.Outputs)
assert.Equal(t, []*string([]*string(nil)), run.Errors)
assert.Equal(t, []*string(nil), run.Outputs)
assert.Equal(t, []*string(nil), run.Errors)

testutils.WaitForLogMessage(t, o, "Sending transaction")
b.Commit() // Needs at least two confirmations
Expand Down Expand Up @@ -570,8 +570,8 @@ observationSource = """
cltest.AwaitJobActive(t, app.JobSpawner(), j.ID, testutils.WaitTimeout(t))

run := cltest.CreateJobRunViaUser(t, app, j.ExternalJobID, "")
assert.Equal(t, []*string([]*string(nil)), run.Outputs)
assert.Equal(t, []*string([]*string(nil)), run.Errors)
assert.Equal(t, []*string(nil), run.Outputs)
assert.Equal(t, []*string(nil), run.Errors)

testutils.WaitForLogMessage(t, o, "Sending transaction")
b.Commit() // Needs at least two confirmations
Expand Down Expand Up @@ -608,8 +608,8 @@ observationSource = """
cltest.AwaitJobActive(t, app.JobSpawner(), j.ID, testutils.WaitTimeout(t))

run := cltest.CreateJobRunViaUser(t, app, j.ExternalJobID, "")
assert.Equal(t, []*string([]*string(nil)), run.Outputs)
assert.Equal(t, []*string([]*string(nil)), run.Errors)
assert.Equal(t, []*string(nil), run.Outputs)
assert.Equal(t, []*string(nil), run.Errors)

testutils.WaitForLogMessage(t, o, "Sending transaction")
b.Commit() // Needs at least two confirmations
Expand Down
10 changes: 5 additions & 5 deletions core/null/int64.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (i *Int64) UnmarshalJSON(data []byte) error {
// Unmarshal again, directly to value, to avoid intermediate float64
err = json.Unmarshal(data, &i.Int64)
case string:
str := string(x)
str := x
if len(str) == 0 {
i.Valid = false
return nil
Expand Down Expand Up @@ -85,7 +85,7 @@ func (i Int64) MarshalJSON() ([]byte, error) {
if !i.Valid {
return []byte("null"), nil
}
return []byte(strconv.FormatInt(int64(i.Int64), 10)), nil
return []byte(strconv.FormatInt(i.Int64, 10)), nil
}

// MarshalText implements encoding.TextMarshaler.
Expand All @@ -94,7 +94,7 @@ func (i Int64) MarshalText() ([]byte, error) {
if !i.Valid {
return []byte{}, nil
}
return []byte(strconv.FormatInt(int64(i.Int64), 10)), nil
return []byte(strconv.FormatInt(i.Int64, 10)), nil
}

// SetValid changes this Int64's value and also sets it to be non-null.
Expand All @@ -112,7 +112,7 @@ func (i Int64) Value() (driver.Value, error) {
// golang's sql driver types as determined by IsValue only supports:
// []byte, bool, float64, int64, string, time.Time
// https://golang.org/src/database/sql/driver/types.go
return int64(i.Int64), nil
return i.Int64, nil
}

// Scan reads the database value and returns an instance.
Expand All @@ -130,7 +130,7 @@ func (i *Int64) Scan(value interface{}) error {
safe := int64(typed)
*i = Int64From(safe)
case int64:
safe := int64(typed)
safe := typed
*i = Int64From(safe)
case uint:
if typed > uint(math.MaxInt64) {
Expand Down
2 changes: 1 addition & 1 deletion core/null/uint32.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (i *Uint32) UnmarshalJSON(data []byte) error {
// Unmarshal again, directly to value, to avoid intermediate float64
err = json.Unmarshal(data, &i.Uint32)
case string:
str := string(x)
str := x
if len(str) == 0 {
i.Valid = false
return nil
Expand Down
6 changes: 3 additions & 3 deletions core/scripts/ocr2vrf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func main() {
*consumerAddress,
uint16(*numWords),
decimal.RequireFromString(*subID).BigInt(),
big.NewInt(int64(*confDelay)),
big.NewInt(*confDelay),
uint32(*callbackGasLimit),
nil, // test consumer doesn't use any args
)
Expand All @@ -389,7 +389,7 @@ func main() {
*consumerAddress,
uint16(*numWords),
decimal.RequireFromString(*subID).BigInt(),
big.NewInt(int64(*confDelay)),
big.NewInt(*confDelay),
uint32(*callbackGasLimit),
nil, // test consumer doesn't use any args,
big.NewInt(*batchSize),
Expand All @@ -411,7 +411,7 @@ func main() {
*consumerAddress,
uint16(*numWords),
decimal.RequireFromString(*subID).BigInt(),
big.NewInt(int64(*confDelay)),
big.NewInt(*confDelay),
uint32(*callbackGasLimit),
nil, // test consumer doesn't use any args,
big.NewInt(*batchSize),
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/vrfv2/testnet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ func main() {
helpers.ParseArgs(addSubConsCmd, os.Args[2:], "coordinator-address", "sub-id", "consumer-address")
coordinator, err := vrf_coordinator_v2.NewVRFCoordinatorV2(common.HexToAddress(*coordinatorAddress), e.Ec)
helpers.PanicErr(err)
v2scripts.EoaAddConsumerToSub(e, *coordinator, uint64(*subID), *consumerAddress)
v2scripts.EoaAddConsumerToSub(e, *coordinator, *subID, *consumerAddress)
case "eoa-create-fund-authorize-sub":
// Lets just treat the owner key as the EOA controlling the sub
cfaSubCmd := flag.NewFlagSet("eoa-create-fund-authorize-sub", flag.ExitOnError)
Expand Down
4 changes: 2 additions & 2 deletions core/services/blockhashstore/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func GetUnfulfilledBlocksAndRequests(
blockToRequests := make(map[uint64]map[string]struct{})
requestIDToBlock := make(map[string]uint64)

reqs, err := coordinator.Requests(ctx, uint64(fromBlock), uint64(toBlock))
reqs, err := coordinator.Requests(ctx, fromBlock, toBlock)
if err != nil {
lggr.Errorw("Failed to fetch VRF requests",
"err", err)
Expand All @@ -73,7 +73,7 @@ func GetUnfulfilledBlocksAndRequests(
requestIDToBlock[req.ID] = req.Block
}

fuls, err := coordinator.Fulfillments(ctx, uint64(fromBlock))
fuls, err := coordinator.Fulfillments(ctx, fromBlock)
if err != nil {
lggr.Errorw("Failed to fetch VRF fulfillments",
"err", err)
Expand Down
2 changes: 1 addition & 1 deletion core/services/blockheaderfeeder/block_header_feeder.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (f *BlockHeaderFeeder) Run(ctx context.Context) error {

lggr.Debugw("found lowest block number without blockhash", "minBlockNumber", minBlockNumber)

earliestStoredBlockNumber, err := f.findEarliestBlockNumberWithBlockhash(ctx, lggr, minBlockNumber.Uint64()+1, uint64(toBlock))
earliestStoredBlockNumber, err := f.findEarliestBlockNumberWithBlockhash(ctx, lggr, minBlockNumber.Uint64()+1, toBlock)
if err != nil {
return errors.Wrap(err, "finding earliest blocknumber with blockhash")
}
Expand Down
Loading

0 comments on commit e595f5b

Please sign in to comment.