@@ -578,6 +578,7 @@ func NewTestFromProof(t testing.TB, p *Proof) *TestProof {
578
578
t .Helper ()
579
579
580
580
tp := & TestProof {
581
+ Version : p .Version ,
581
582
PrevOut : p .PrevOut .String (),
582
583
BlockHeader : NewTestFromBlockHeader (t , & p .BlockHeader ),
583
584
BlockHeight : p .BlockHeight ,
@@ -651,6 +652,7 @@ func NewTestFromProof(t testing.TB, p *Proof) *TestProof {
651
652
}
652
653
653
654
type TestProof struct {
655
+ Version TransitionVersion `json:"version"`
654
656
PrevOut string `json:"prev_out"`
655
657
BlockHeader * TestBlockHeader `json:"block_header"`
656
658
BlockHeight uint32 `json:"block_height"`
@@ -673,6 +675,7 @@ func (tp *TestProof) ToProof(t testing.TB) *Proof {
673
675
t .Helper ()
674
676
675
677
p := & Proof {
678
+ Version : tp .Version ,
676
679
PrevOut : test .ParseOutPoint (t , tp .PrevOut ),
677
680
BlockHeader : * tp .BlockHeader .ToBlockHeader (t ),
678
681
BlockHeight : tp .BlockHeight ,
@@ -872,28 +875,57 @@ func NewTestFromCommitmentProof(t testing.TB,
872
875
TapscriptSibling : commitment .HexTapscriptSibling (
873
876
t , p .TapSiblingPreimage ,
874
877
),
878
+ STXOProofs : NewTestFromSTXOProofs (t , p ),
875
879
UnknownOddTypes : p .UnknownOddTypes ,
876
880
}
877
881
}
878
882
883
+ func NewTestFromSTXOProofs (t testing.TB ,
884
+ p * CommitmentProof ) * map [string ]commitment.TestProof {
885
+
886
+ t .Helper ()
887
+
888
+ stxoProofs := make (map [string ]commitment.TestProof )
889
+ for key , proof := range p .STXOProofs {
890
+ keyHex := hex .EncodeToString (key [:])
891
+ stxoProofs [keyHex ] = * commitment .NewTestFromProof (t , & proof )
892
+ }
893
+ return & stxoProofs
894
+ }
895
+
879
896
type TestCommitmentProof struct {
880
- Proof * commitment.TestProof `json:"proof"`
881
- TapscriptSibling string `json:"tapscript_sibling"`
882
- UnknownOddTypes tlv.TypeMap `json:"unknown_odd_types"`
897
+ Proof * commitment.TestProof `json:"proof"`
898
+ TapscriptSibling string `json:"tapscript_sibling"`
899
+ STXOProofs * map [string ]commitment.TestProof `json:"stxo_proofs"`
900
+ UnknownOddTypes tlv.TypeMap `json:"unknown_odd_types"`
883
901
}
884
902
885
903
func (tcp * TestCommitmentProof ) ToCommitmentProof (
886
904
t testing.TB ) * CommitmentProof {
887
905
888
906
t .Helper ()
889
907
890
- return & CommitmentProof {
908
+ stxoProofs := make (map [asset.SerializedKey ]commitment.Proof )
909
+ for key , proof := range * tcp .STXOProofs {
910
+ keyBytes , err := hex .DecodeString (key )
911
+ require .NoError (t , err )
912
+ key := asset .SerializedKey (keyBytes )
913
+ stxoProofs [key ] = * proof .ToProof (t )
914
+ }
915
+
916
+ cp := & CommitmentProof {
891
917
Proof : * tcp .Proof .ToProof (t ),
892
918
TapSiblingPreimage : commitment .ParseTapscriptSibling (
893
919
t , tcp .TapscriptSibling ,
894
920
),
895
921
UnknownOddTypes : tcp .UnknownOddTypes ,
896
922
}
923
+
924
+ if len (stxoProofs ) > 0 {
925
+ cp .STXOProofs = stxoProofs
926
+ }
927
+
928
+ return cp
897
929
}
898
930
899
931
func NewTestFromTapscriptProof (t testing.TB ,
0 commit comments