Commit d32cb678 authored by Hamdi Allam's avatar Hamdi Allam

nits

parent b6c3f32a
...@@ -165,14 +165,10 @@ func TestE2EBridgeTransfersCursoredDeposits(t *testing.T) { ...@@ -165,14 +165,10 @@ func TestE2EBridgeTransfersCursoredDeposits(t *testing.T) {
var depositTx *types.Transaction var depositTx *types.Transaction
l1Opts.Value = big.NewInt(int64((i + 1)) * params.Ether) l1Opts.Value = big.NewInt(int64((i + 1)) * params.Ether)
if i != 1 { if i != 1 {
depositTx, err = transactions.PadGasEstimate(l1Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { depositTx, err = transactions.PadGasEstimate(l1Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { return l1StandardBridge.Receive(opts) })
return l1StandardBridge.Receive(opts)
})
require.NoError(t, err) require.NoError(t, err)
} else { } else {
depositTx, err = transactions.PadGasEstimate(l1Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { depositTx, err = transactions.PadGasEstimate(l1Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { return optimismPortal.Receive(opts) })
return optimismPortal.Receive(opts)
})
require.NoError(t, err) require.NoError(t, err)
} }
...@@ -390,33 +386,17 @@ func TestE2EBridgeTransfersCursoredWithdrawals(t *testing.T) { ...@@ -390,33 +386,17 @@ func TestE2EBridgeTransfersCursoredWithdrawals(t *testing.T) {
l2Opts, err := bind.NewKeyedTransactorWithChainID(testSuite.OpCfg.Secrets.Alice, testSuite.OpCfg.L2ChainIDBig()) l2Opts, err := bind.NewKeyedTransactorWithChainID(testSuite.OpCfg.Secrets.Alice, testSuite.OpCfg.L2ChainIDBig())
require.NoError(t, err) require.NoError(t, err)
// Ensure L1 has enough funds for the withdrawal by depositing an equal amount into the OptimismPortal // Withdraw 1/2/3 ETH (second deposit via the l2ToL1MP). We dont ever finalize these withdrawals on
func() { // L1 so we dont have to worry about funding the OptimismPortal contract with ETH
optimismPortal, err := bindings.NewOptimismPortal(testSuite.OpCfg.L1Deployments.OptimismPortalProxy, testSuite.L1Client)
require.NoError(t, err)
l1Opts, err := bind.NewKeyedTransactorWithChainID(testSuite.OpCfg.Secrets.Alice, testSuite.OpCfg.L1ChainIDBig())
require.NoError(t, err)
l1Opts.Value = big.NewInt(6 * params.Ether)
depositTx, err := optimismPortal.Receive(l1Opts)
require.NoError(t, err)
_, err = wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
require.NoError(t, err)
}()
// Withdraw 1/2/3 ETH (second deposit via the l2ToL1MP)
var withdrawReceipts [3]*types.Receipt var withdrawReceipts [3]*types.Receipt
for i := 0; i < 3; i++ { for i := 0; i < 3; i++ {
var withdrawTx *types.Transaction var withdrawTx *types.Transaction
l2Opts.Value = big.NewInt(int64((i + 1)) * params.Ether) l2Opts.Value = big.NewInt(int64((i + 1)) * params.Ether)
if i != 1 { if i != 1 {
withdrawTx, err = transactions.PadGasEstimate(l2Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { withdrawTx, err = transactions.PadGasEstimate(l2Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { return l2StandardBridge.Receive(opts) })
return l2StandardBridge.Receive(opts)
})
require.NoError(t, err) require.NoError(t, err)
} else { } else {
withdrawTx, err = transactions.PadGasEstimate(l2Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { withdrawTx, err = transactions.PadGasEstimate(l2Opts, 1.1, func(opts *bind.TransactOpts) (*types.Transaction, error) { return l2ToL1MP.Receive(opts) })
return l2ToL1MP.Receive(opts)
})
require.NoError(t, err) require.NoError(t, err)
} }
......
...@@ -43,9 +43,9 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite { ...@@ -43,9 +43,9 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite {
dbUser := os.Getenv("DB_USER") dbUser := os.Getenv("DB_USER")
dbName := setupTestDatabase(t) dbName := setupTestDatabase(t)
// Replace the handler of the global logger with the testlog // Discard the Global Logger as each component
logger := testlog.Logger(t, log.LvlInfo) // has its own configured logger
log.Root().SetHandler(logger.GetHandler()) log.Root().SetHandler(log.DiscardHandler())
// Rollup System Configuration and Start // Rollup System Configuration and Start
opCfg := op_e2e.DefaultSystemConfig(t) opCfg := op_e2e.DefaultSystemConfig(t)
...@@ -90,7 +90,8 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite { ...@@ -90,7 +90,8 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite {
require.NoError(t, err) require.NoError(t, err)
t.Cleanup(func() { db.Close() }) t.Cleanup(func() { db.Close() })
indexer, err := indexer.NewIndexer(logger, db, indexerCfg.Chain, indexerCfg.RPCs, indexerCfg.Metrics) indexerLog := testlog.Logger(t, log.LvlInfo).New("role", "indexer")
indexer, err := indexer.NewIndexer(indexerLog, db, indexerCfg.Chain, indexerCfg.RPCs, indexerCfg.Metrics)
require.NoError(t, err) require.NoError(t, err)
indexerCtx, indexerStop := context.WithCancel(context.Background()) indexerCtx, indexerStop := context.WithCancel(context.Background())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment