Skip to content

Commit

Permalink
shadow: declaration of X shadows declaration at line Y (govet) (#10917)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Oct 16, 2023
1 parent 2fa47e5 commit 873aa6b
Show file tree
Hide file tree
Showing 36 changed files with 632 additions and 835 deletions.
26 changes: 13 additions & 13 deletions core/chains/evm/gas/block_history_estimator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,21 @@ func TestBlockHistoryEstimator_Start(t *testing.T) {
})

t.Run("starts and loads partial history if fetch context times out", func(t *testing.T) {
geCfg := &gas.MockGasEstimatorConfig{}
geCfg.EIP1559DynamicFeesF = true
geCfg.LimitMultiplierF = float32(1)
geCfg.PriceMinF = minGasPrice

bhCfg := newBlockHistoryConfig()
bhCfg.BatchSizeF = uint32(1)
bhCfg.BlockDelayF = blockDelay
bhCfg.BlockHistorySizeF = historySize
bhCfg.TransactionPercentileF = percentile

cfg := gas.NewMockConfig()
geCfg2 := &gas.MockGasEstimatorConfig{}
geCfg2.EIP1559DynamicFeesF = true
geCfg2.LimitMultiplierF = float32(1)
geCfg2.PriceMinF = minGasPrice

bhCfg2 := newBlockHistoryConfig()
bhCfg2.BatchSizeF = uint32(1)
bhCfg2.BlockDelayF = blockDelay
bhCfg2.BlockHistorySizeF = historySize
bhCfg2.TransactionPercentileF = percentile

cfg2 := gas.NewMockConfig()
ethClient := evmtest.NewEthClientMockWithDefaultChain(t)

bhe := newBlockHistoryEstimator(t, ethClient, cfg, geCfg, bhCfg)
bhe := newBlockHistoryEstimator(t, ethClient, cfg2, geCfg2, bhCfg2)

h := &evmtypes.Head{Hash: utils.NewHash(), Number: 42, BaseFeePerGas: assets.NewWeiI(420)}
ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(h, nil)
Expand Down
13 changes: 4 additions & 9 deletions core/chains/evm/log/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ func (helper *broadcasterHelper) stop() {
assert.NoError(helper.t, err)
}

func newMockContract() *logmocks.AbigenContract {
func newMockContract(t *testing.T) *logmocks.AbigenContract {
addr := testutils.NewAddress()
contract := new(logmocks.AbigenContract)
contract.On("Address").Return(addr)
contract := logmocks.NewAbigenContract(t)
contract.On("Address").Return(addr).Maybe()
return contract
}

Expand Down Expand Up @@ -329,15 +329,10 @@ func (listener *simpleLogListener) getUniqueLogsBlockNumbers() []uint64 {

func (listener *simpleLogListener) requireAllReceived(t *testing.T, expectedState *received) {
received := listener.received
defer func() { assert.EqualValues(t, expectedState.getUniqueLogs(), received.getUniqueLogs()) }()
require.Eventually(t, func() bool {
return len(received.getUniqueLogs()) == len(expectedState.getUniqueLogs())
}, testutils.WaitTimeout(t), time.Second, "len(received.uniqueLogs): %v is not equal len(expectedState.uniqueLogs): %v", len(received.getUniqueLogs()), len(expectedState.getUniqueLogs()))

received.Lock()
defer received.Unlock()
for i, ul := range expectedState.getUniqueLogs() {
assert.Equal(t, ul, received.uniqueLogs[i])
}
}

func (listener *simpleLogListener) handleLogBroadcast(lb log.Broadcast) bool {
Expand Down
Loading

0 comments on commit 873aa6b

Please sign in to comment.