Skip to content

Commit

Permalink
fix(op-plasma-eigenda): Fix encoding - rm dbug stmts
Browse files Browse the repository at this point in the history
  • Loading branch information
epociask committed May 17, 2024
1 parent 1758602 commit 2165a28
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type CommitmentType byte
const (
// default commitment type for the DA storage.
Keccak256CommitmentType CommitmentType = 0
DaService CommitmentType = 1
GenericCommitment CommitmentType = 1
)

type ExtDAType byte
Expand Down Expand Up @@ -78,7 +78,6 @@ func DecodeKeccak256(commitment []byte) (Keccak256Commitment, error) {
return c, nil
}

// NOTE - This logic will need to be migrated into layr-labs/op-stack directly
type EigenDACommitment []byte

func (c EigenDACommitment) Encode() []byte {
Expand All @@ -93,19 +92,16 @@ func DecodeEigenDACommitment(commitment []byte) (EigenDACommitment, error) {
if len(commitment) <= 3 {
return nil, ErrCommitmentLength
}
if commitment[0] != byte(DaService) {
println("commitment[0] != byte(DaService)")
if commitment[0] != byte(GenericCommitment) {
return nil, ErrInvalidCommitment
}

if commitment[1] != byte(EigenDA) {
println("commitment[1] != byte(EigenDA)")
return nil, ErrInvalidCommitment
}

// additional versions will need to be hardcoded here
if commitment[2] != byte(EigenV0) {
println("commitment[2] != byte(EigenDA)")
return nil, ErrInvalidCommitment
}

Expand Down

0 comments on commit 2165a28

Please sign in to comment.