Skip to content

Commit

Permalink
test tweaks (#10636)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Sep 14, 2023
1 parent cc4ffed commit 3f1ec39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion core/cmd/shell_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ func TestShell_RebroadcastTransactions_AddressCheck(t *testing.T) {
}

set := flag.NewFlagSet("test", 0)
set.Set("evmChainID", testutils.SimulatedChainID.String())
cltest.FlagSetApplyFromAction(client.RebroadcastTransactions, set, "")

require.NoError(t, set.Set("address", fromAddress.Hex()))
Expand Down
20 changes: 12 additions & 8 deletions core/internal/cltest/cltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,19 @@ func NewEthMocksWithTransactionsOnBlocksAssertions(t testing.TB) *evmclimocks.Cl
c.On("HeadByHash", mock.Anything, h0.Hash).Maybe().Return(h0, nil)
c.On("BatchCallContext", mock.Anything, mock.Anything).Maybe().Return(nil).Run(func(args mock.Arguments) {
elems := args.Get(1).([]rpc.BatchElem)
elems[0].Result = &evmtypes.Block{
Number: 42,
Hash: utils.NewHash(),
Transactions: LegacyTransactionsFromGasPrices(9001, 9002),
if len(elems) > 0 {
elems[0].Result = &evmtypes.Block{
Number: 42,
Hash: utils.NewHash(),
Transactions: LegacyTransactionsFromGasPrices(9001, 9002),
}
}
elems[1].Result = &evmtypes.Block{
Number: 41,
Hash: utils.NewHash(),
Transactions: LegacyTransactionsFromGasPrices(9003, 9004),
if len(elems) > 1 {
elems[1].Result = &evmtypes.Block{
Number: 41,
Hash: utils.NewHash(),
Transactions: LegacyTransactionsFromGasPrices(9003, 9004),
}
}
})
c.On("ConfiguredChainID").Maybe().Return(&FixtureChainID)
Expand Down

0 comments on commit 3f1ec39

Please sign in to comment.