Skip to content

Commit

Permalink
Fix failing verifier test
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyknox committed May 29, 2024
1 parent d17c2d3 commit db4d7fa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ clean:
rm bin/eigenda-proxy

test:
go test -v ./... -test.skip ".*E2E.*"
go test -v ./...

e2e-test: submodules srs
go test -timeout 50m -v ./test/e2e_test.go
go test -timeout 50m -v -testnet-integration ./test/e2e_test.go

.PHONY: lint
lint:
Expand Down
11 changes: 11 additions & 0 deletions test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package test

import (
"context"
"flag"
"fmt"
"os"
"runtime"
Expand All @@ -23,6 +24,12 @@ import (
"github.com/stretchr/testify/assert"
)

var runTestnetIntegrationTests bool

func init() {
flag.BoolVar(&runTestnetIntegrationTests, "testnet-integration", false, "Run testnet-based integration tests")
}

// Use of single port makes tests incapable of running in parallel
const (
transport = "http"
Expand Down Expand Up @@ -107,6 +114,10 @@ func createTestSuite(t *testing.T) (TestSuite, func()) {
}

func TestE2EPutGetLogicForEigenDAStore(t *testing.T) {
if !runTestnetIntegrationTests {
t.Skip("Skipping testnet integration test")
}

ts, kill := createTestSuite(t)
defer kill()

Expand Down
12 changes: 3 additions & 9 deletions verify/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,9 @@ func (v *Verifier) Verify(cert eigenda.Cert, blob []byte) error {
x, y := cert.BlobCommitmentFields()

errMsg := ""
if !commit.X.Equal(x) {
errMsg += fmt.Sprintf(" x element mismatch %s : %s %s : %s,", "generated_commit", commit.X.String(), "initial_commit", x.String())
}

if !commit.Y.Equal(y) {
errMsg += fmt.Sprintf(" y element mismatch %s : %s %s : %s,", "generated_commit", commit.Y.String(), "initial_commit", y.String())
}

if errMsg != "" {
if !commit.X.Equal(x) || !commit.Y.Equal(y) {
errMsg += fmt.Sprintf("field elements do not match, x generated commit: %x, x initial commit: %x, ", commit.X.Marshal(), (*x).Marshal())
errMsg += fmt.Sprintf("y generated commit: %x, y initial commit: %x", commit.Y.Marshal(), (*y).Marshal())
return fmt.Errorf(errMsg)
}

Expand Down
4 changes: 2 additions & 2 deletions verify/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ func TestVerification(t *testing.T) {

var data = []byte("inter-subjective and not objective!")

x, err := hex.DecodeString("0184B47F64FBA17D6F49CDFED20434B1015A2A369AB203256EC4CD00C324E83B")
x, err := hex.DecodeString("07c23d7720de3f10064c8f48774d8f59207964c482419063246a67e1c454a886")
assert.NoError(t, err)

y, err := hex.DecodeString("122CD859CC5CDD048B482C50721821CB413C151BA7AF10285C1D2483F2A88085")
y, err := hex.DecodeString("0f747070e6fdb4e1346fec54dbc3d2d61a2c9ad2cb6b1744fa7f47072ad13370")
assert.NoError(t, err)

c := eigenda.Cert{
Expand Down

0 comments on commit db4d7fa

Please sign in to comment.