@@ -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,58 @@ 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
+
896
+ // nolint: lll
879
897
type TestCommitmentProof struct {
880
- Proof * commitment.TestProof `json:"proof"`
881
- TapscriptSibling string `json:"tapscript_sibling"`
882
- UnknownOddTypes tlv.TypeMap `json:"unknown_odd_types"`
898
+ Proof * commitment.TestProof `json:"proof"`
899
+ TapscriptSibling string `json:"tapscript_sibling"`
900
+ STXOProofs * map [string ]commitment.TestProof `json:"stxo_proofs"`
901
+ UnknownOddTypes tlv.TypeMap `json:"unknown_odd_types"`
883
902
}
884
903
885
904
func (tcp * TestCommitmentProof ) ToCommitmentProof (
886
905
t testing.TB ) * CommitmentProof {
887
906
888
907
t .Helper ()
889
908
890
- return & CommitmentProof {
909
+ stxoProofs := make (map [asset.SerializedKey ]commitment.Proof )
910
+ for key , proof := range * tcp .STXOProofs {
911
+ keyBytes , err := hex .DecodeString (key )
912
+ require .NoError (t , err )
913
+ key := asset .SerializedKey (keyBytes )
914
+ stxoProofs [key ] = * proof .ToProof (t )
915
+ }
916
+
917
+ cp := & CommitmentProof {
891
918
Proof : * tcp .Proof .ToProof (t ),
892
919
TapSiblingPreimage : commitment .ParseTapscriptSibling (
893
920
t , tcp .TapscriptSibling ,
894
921
),
895
922
UnknownOddTypes : tcp .UnknownOddTypes ,
896
923
}
924
+
925
+ if len (stxoProofs ) > 0 {
926
+ cp .STXOProofs = stxoProofs
927
+ }
928
+
929
+ return cp
897
930
}
898
931
899
932
func NewTestFromTapscriptProof (t testing.TB ,
0 commit comments