Skip to content

Commit

Permalink
fix: Resolve commitment decoding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
epociask committed Aug 6, 2024
1 parent c3e675f commit 0593497
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"path"
"strconv"
"strings"
"time"

"github.com/Layr-Labs/eigenda-proxy/commitments"
Expand Down Expand Up @@ -260,6 +261,10 @@ func ReadCommitmentMode(r *http.Request) (commitments.CommitmentMode, error) {
if key == "" { // default
commit := path.Base(r.URL.Path)
if len(commit) > 0 && commit != "put" { // provided commitment in request params
if !strings.HasPrefix(commit, "0x") {
commit = "0x" + commit
}

decodedCommit, err := hexutil.Decode(commit)
if err != nil {
return commitments.SimpleCommitmentMode, err
Expand Down

0 comments on commit 0593497

Please sign in to comment.