From 98c0585e56af3080ae0100a6e84ccb7e909e1d60 Mon Sep 17 00:00:00 2001 From: Teddy Knox Date: Sun, 21 Jul 2024 00:35:15 -0400 Subject: [PATCH] Fix NPE on Optimism test --- e2e/optimism_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/e2e/optimism_test.go b/e2e/optimism_test.go index a8f20e0..d115f38 100644 --- a/e2e/optimism_test.go +++ b/e2e/optimism_test.go @@ -66,7 +66,7 @@ func NewL2PlasmaDA(t actions.Testing, daHost string, altDA bool) *L2PlasmaDA { var storage *plasma.DAClient if !altDA { - storage = plasma.NewDAClient(daHost, true, true) + storage = plasma.NewDAClient(daHost, true, true) } else { storage = plasma.NewDAClient(daHost, false, false) } @@ -78,7 +78,7 @@ func NewL2PlasmaDA(t actions.Testing, daHost string, altDA bool) *L2PlasmaDA { require.NoError(t, err) if altDA { - plasmaCfg.CommitmentType = plasma.GenericCommitmentType + plasmaCfg.CommitmentType = plasma.GenericCommitmentType } else { plasmaCfg.CommitmentType = plasma.Keccak256CommitmentType } @@ -116,7 +116,6 @@ func (a *L2PlasmaDA) ActL1Finalized(t actions.Testing) { a.sequencer.ActL1FinalizedSignal(t) } - func TestOptimismKeccak256Commitment(gt *testing.T) { if !runIntegrationTests && !runTestnetIntegrationTests { gt.Skip("Skipping test as INTEGRATION or TESTNET env var not set") @@ -170,7 +169,6 @@ func TestOptimismKeccak256Commitment(gt *testing.T) { require.Equal(t, 1, stat.Reads) } - func TestOptimismAltDACommitment(gt *testing.T) { if !runIntegrationTests && !runTestnetIntegrationTests { gt.Skip("Skipping test as INTEGRATION or TESTNET env var not set") @@ -218,8 +216,10 @@ func TestOptimismAltDACommitment(gt *testing.T) { op_stack.ActL1Finalized(t) // assert that EigenDA proxy's was written and read from - stat := proxyTS.Server.GetMemStats() - require.Equal(t, 1, stat.Entries) - require.Equal(t, 1, stat.Reads) + if useMemory() { + stat := proxyTS.Server.GetMemStats() + require.Equal(t, 1, stat.Entries) + require.Equal(t, 1, stat.Reads) + } }