Skip to content

Commit 725eace

Browse files
committed
proof: add Proof.Bytes method
1 parent 2da076d commit 725eace

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

proof/proof.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,16 @@ func (p *Proof) Decode(r io.Reader) error {
460460
return nil
461461
}
462462

463+
// Bytes returns the serialized proof.
464+
func (p *Proof) Bytes() ([]byte, error) {
465+
var buf bytes.Buffer
466+
err := p.Encode(&buf)
467+
if err != nil {
468+
return nil, err
469+
}
470+
return buf.Bytes(), nil
471+
}
472+
463473
// Record returns a TLV record that can be used to encode/decode a Proof to/from
464474
// a TLV stream.
465475
//

0 commit comments

Comments
 (0)