Skip to content

Commit

Permalink
fix(cli): fix proof in readerclient
Browse files Browse the repository at this point in the history
  • Loading branch information
GMKrieger committed Jan 22, 2024
1 parent 350841e commit 697089d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/readerclient/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Proof struct {
OutputHashesInEpochSiblings []hexutil.Bytes `json:"outputHashesInEpochSiblings"`
// Data that allows the validity proof to be contextualized within submitted claims,
// given as a payload in Ethereum hex binary format, starting with '0x'
Context string `json:"context"`
Context hexutil.Bytes `json:"context"`
}

func newProof(
Expand Down Expand Up @@ -96,8 +96,14 @@ func newProof(
return nil, fmt.Errorf("failed to decode MachineStateHash to bytes: %v", err)
}

outputHashEpochSiblings = append(outputHashOutputSiblings, tempHash)
outputHashEpochSiblings = append(outputHashEpochSiblings, tempHash)
}

contextBytes, err := hexutil.Decode(context)
if err != nil {
return nil, fmt.Errorf("failed to decode Context to bytes: %v", err)
}

proof := Proof{
inputIndexWithinEpoch,
outputIndexWithinInput,
Expand All @@ -107,7 +113,7 @@ func newProof(
machineHash,
outputHashOutputSiblings,
outputHashEpochSiblings,
context,
contextBytes,
}

return &proof, err
Expand Down

0 comments on commit 697089d

Please sign in to comment.