diff --git a/e2e/server_test.go b/e2e/server_test.go index 12f64f17..a2431231 100644 --- a/e2e/server_test.go +++ b/e2e/server_test.go @@ -23,6 +23,8 @@ func isNilPtrDerefPanic(err string) bool { strings.Contains(err, "nil pointer dereference") } +// TestOpClientKeccak256MalformedInputs tests the NewDAClient from op_plasma by setting and getting against []byte("") +// preimage. It sets the precompute option to false on the NewDAClient. func TestOpClientKeccak256MalformedInputs(t *testing.T) { if !runIntegrationTests || runTestnetIntegrationTests { t.Skip("Skipping test as TESTNET env set or INTEGRATION var not set") @@ -61,6 +63,7 @@ func TestOpClientKeccak256MalformedInputs(t *testing.T) { require.Error(t, err) // Should not fail on slice bounds out of range. This needs to be fixed by OP. + // Refer to issue: https://github.com/ethereum-optimism/optimism/issues/11987 // assert.False(t, strings.Contains(err.Error(), ": EOF") && !isPanic(err.Error())) }) @@ -148,6 +151,9 @@ func TestOptimismClientWithGenericCommitment(t *testing.T) { require.Equal(t, testPreimage, preimage) } +// TestProxyClientServerIntegration tests the proxy client and server integration by setting the data as a single byte, +// many unicode characters, single unicode character and an empty preimage. It then tries to get the data from the +// proxy server with empty byte, single byte and random string. func TestProxyClientServerIntegration(t *testing.T) { if !runIntegrationTests && !runTestnetIntegrationTests { t.Skip("Skipping test as INTEGRATION or TESTNET env var not set") @@ -165,19 +171,19 @@ func TestProxyClientServerIntegration(t *testing.T) { daClient := client.New(cfg) t.Run("single byte preimage set data case", func(t *testing.T) { - testPreimage := []byte{1} // Empty preimage + testPreimage := []byte{1} // single byte preimage t.Log("Setting input data on proxy server...") _, err := daClient.SetData(ts.Ctx, testPreimage) require.NoError(t, err) }) t.Run("unicode preimage set data case", func(t *testing.T) { - testPreimage := []byte("§§©ˆªªˆ˙√ç®∂§∞¶§ƒ¥√¨¥√¨¥ƒƒ©˙˜ø˜˜˜∫˙∫¥∫√†®®√稈¨˙ï") // Empty preimage + testPreimage := []byte("§§©ˆªªˆ˙√ç®∂§∞¶§ƒ¥√¨¥√¨¥ƒƒ©˙˜ø˜˜˜∫˙∫¥∫√†®®√稈¨˙ï") // many unicode characters t.Log("Setting input data on proxy server...") _, err := daClient.SetData(ts.Ctx, testPreimage) require.NoError(t, err) - testPreimage = []byte("§") // Empty preimage + testPreimage = []byte("§") // single unicode character t.Log("Setting input data on proxy server...") _, err = daClient.SetData(ts.Ctx, testPreimage) require.NoError(t, err)