Skip to content

Commit

Permalink
test: add e2e test for keccak commitment to expect error from s3 back…
Browse files Browse the repository at this point in the history
…end not set
  • Loading branch information
samlaf committed Sep 17, 2024
1 parent b027fe9 commit b141432
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions e2e/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,30 @@ func TestOptimismClientWithKeccak256Commitment(t *testing.T) {
require.Equal(t, testPreimage, preimage)
}

func TestKeccak256CommitmentRequestErrorsWhenS3NotSet(t *testing.T) {
if !runIntegrationTests && !runTestnetIntegrationTests {
t.Skip("Skipping test as INTEGRATION or TESTNET env var not set")
}

t.Parallel()

testCfg := e2e.TestConfig(useMemory())
testCfg.UseKeccak256ModeS3 = true

tsConfig := e2e.TestSuiteConfig(t, testCfg)
tsConfig.S3Config.Endpoint = ""
ts, kill := e2e.CreateTestSuite(t, tsConfig)
defer kill()

daClient := op_plasma.NewDAClient(ts.Address(), false, true)

testPreimage := []byte(e2e.RandString(100))

_, err := daClient.SetInput(ts.Ctx, testPreimage)
// TODO: the server currently returns an internal server error. Should it return a 400 instead?
require.Error(t, err)
}

/*
this test asserts that the data can be posted/read to EigenDA
with a concurrent S3 backend configured
Expand Down

0 comments on commit b141432

Please sign in to comment.