Skip to content

Commit

Permalink
fix(nodebuilder): submit input validation
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg committed Dec 2, 2024
1 parent 61d9a32 commit 3e33492
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nodebuilder/blob/cmd/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,18 @@ var submitCmd = &cobra.Command{
jsonBlobs := make([]blobJSON, 0)
// In case of there is a file input, get the namespace and blob from the arguments
if path != "" {
paresdBlobs, err := parseSubmitBlobs(path)
parsedBlobs, err := parseSubmitBlobs(path)
if err != nil {
return err
}

jsonBlobs = append(jsonBlobs, paresdBlobs...)
jsonBlobs = append(jsonBlobs, parsedBlobs...)
} else {
jsonBlobs = append(jsonBlobs, blobJSON{Namespace: args[0], BlobData: args[1]})
blobData, err := cmdnode.DecodeToBytes(args[1])
if err != nil { // can be simple text
blobData = []byte(args[1])
}
jsonBlobs = append(jsonBlobs, blobJSON{Namespace: args[0], BlobData: string(blobData)})
}

var resultBlobs []*blob.Blob
Expand Down

0 comments on commit 3e33492

Please sign in to comment.