diff --git a/pkg/readerclient/proof.go b/pkg/readerclient/proof.go index 4a07121f2..a3e920f68 100644 --- a/pkg/readerclient/proof.go +++ b/pkg/readerclient/proof.go @@ -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( @@ -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, @@ -107,7 +113,7 @@ func newProof( machineHash, outputHashOutputSiblings, outputHashEpochSiblings, - context, + contextBytes, } return &proof, err