@@ -23,6 +23,7 @@ import (
2323 "github.com/lightningnetwork/lnd/keychain"
2424 "github.com/lightningnetwork/lnd/lnutils"
2525 "github.com/lightningnetwork/lnd/lnwire"
26+ "github.com/lightningnetwork/lnd/tlv"
2627 "github.com/stretchr/testify/require"
2728)
2829
@@ -566,13 +567,14 @@ func NewTestFromProof(t testing.TB, p *Proof) *TestProof {
566567 t .Helper ()
567568
568569 tp := & TestProof {
569- PrevOut : p .PrevOut .String (),
570- BlockHeader : NewTestFromBlockHeader (t , & p .BlockHeader ),
571- BlockHeight : p .BlockHeight ,
572- AnchorTx : test .HexTx (t , & p .AnchorTx ),
573- TxMerkleProof : NewTestFromTxMerkleProof (t , & p .TxMerkleProof ),
574- Asset : asset .NewTestFromAsset (t , & p .Asset ),
575- InclusionProof : NewTestFromTaprootProof (t , & p .InclusionProof ),
570+ PrevOut : p .PrevOut .String (),
571+ BlockHeader : NewTestFromBlockHeader (t , & p .BlockHeader ),
572+ BlockHeight : p .BlockHeight ,
573+ AnchorTx : test .HexTx (t , & p .AnchorTx ),
574+ TxMerkleProof : NewTestFromTxMerkleProof (t , & p .TxMerkleProof ),
575+ Asset : asset .NewTestFromAsset (t , & p .Asset ),
576+ InclusionProof : NewTestFromTaprootProof (t , & p .InclusionProof ),
577+ UnknownOddTypes : p .UnknownOddTypes ,
576578 }
577579
578580 for i := range p .ExclusionProofs {
@@ -637,19 +639,21 @@ type TestProof struct {
637639 ChallengeWitness []string `json:"challenge_witness"`
638640 GenesisReveal * asset.TestGenesisReveal `json:"genesis_reveal"`
639641 GroupKeyReveal * asset.TestGroupKeyReveal `json:"group_key_reveal"`
642+ UnknownOddTypes tlv.TypeMap `json:"unknown_odd_types"`
640643}
641644
642645func (tp * TestProof ) ToProof (t testing.TB ) * Proof {
643646 t .Helper ()
644647
645648 p := & Proof {
646- PrevOut : test .ParseOutPoint (t , tp .PrevOut ),
647- BlockHeader : * tp .BlockHeader .ToBlockHeader (t ),
648- BlockHeight : tp .BlockHeight ,
649- AnchorTx : * test .ParseTx (t , tp .AnchorTx ),
650- TxMerkleProof : * tp .TxMerkleProof .ToTxMerkleProof (t ),
651- Asset : * tp .Asset .ToAsset (t ),
652- InclusionProof : * tp .InclusionProof .ToTaprootProof (t ),
649+ PrevOut : test .ParseOutPoint (t , tp .PrevOut ),
650+ BlockHeader : * tp .BlockHeader .ToBlockHeader (t ),
651+ BlockHeight : tp .BlockHeight ,
652+ AnchorTx : * test .ParseTx (t , tp .AnchorTx ),
653+ TxMerkleProof : * tp .TxMerkleProof .ToTxMerkleProof (t ),
654+ Asset : * tp .Asset .ToAsset (t ),
655+ InclusionProof : * tp .InclusionProof .ToTaprootProof (t ),
656+ UnknownOddTypes : tp .UnknownOddTypes ,
653657 }
654658
655659 for i := range tp .ExclusionProofs {
@@ -774,8 +778,9 @@ func NewTestFromTaprootProof(t testing.TB,
774778 t .Helper ()
775779
776780 ttp := & TestTaprootProof {
777- OutputIndex : p .OutputIndex ,
778- InternalKey : test .HexPubKey (p .InternalKey ),
781+ OutputIndex : p .OutputIndex ,
782+ InternalKey : test .HexPubKey (p .InternalKey ),
783+ UnknownOddTypes : p .UnknownOddTypes ,
779784 }
780785
781786 if p .CommitmentProof != nil {
@@ -798,14 +803,16 @@ type TestTaprootProof struct {
798803 InternalKey string `json:"internal_key"`
799804 CommitmentProof * TestCommitmentProof `json:"commitment_proof"`
800805 TapscriptProof * TestTapscriptProof `json:"tapscript_proof"`
806+ UnknownOddTypes tlv.TypeMap `json:"unknown_odd_types"`
801807}
802808
803809func (ttp * TestTaprootProof ) ToTaprootProof (t testing.TB ) * TaprootProof {
804810 t .Helper ()
805811
806812 p := & TaprootProof {
807- OutputIndex : ttp .OutputIndex ,
808- InternalKey : test .ParsePubKey (t , ttp .InternalKey ),
813+ OutputIndex : ttp .OutputIndex ,
814+ InternalKey : test .ParsePubKey (t , ttp .InternalKey ),
815+ UnknownOddTypes : ttp .UnknownOddTypes ,
809816 }
810817
811818 if ttp .CommitmentProof != nil {
@@ -829,12 +836,14 @@ func NewTestFromCommitmentProof(t testing.TB,
829836 TapscriptSibling : commitment .HexTapscriptSibling (
830837 t , p .TapSiblingPreimage ,
831838 ),
839+ UnknownOddTypes : p .UnknownOddTypes ,
832840 }
833841}
834842
835843type TestCommitmentProof struct {
836844 Proof * commitment.TestProof `json:"proof"`
837845 TapscriptSibling string `json:"tapscript_sibling"`
846+ UnknownOddTypes tlv.TypeMap `json:"unknown_odd_types"`
838847}
839848
840849func (tcp * TestCommitmentProof ) ToCommitmentProof (
@@ -847,6 +856,7 @@ func (tcp *TestCommitmentProof) ToCommitmentProof(
847856 TapSiblingPreimage : commitment .ParseTapscriptSibling (
848857 t , tcp .TapscriptSibling ,
849858 ),
859+ UnknownOddTypes : tcp .UnknownOddTypes ,
850860 }
851861}
852862
@@ -856,16 +866,22 @@ func NewTestFromTapscriptProof(t testing.TB,
856866 t .Helper ()
857867
858868 return & TestTapscriptProof {
859- TapPreimage1 : commitment .HexTapscriptSibling (t , p .TapPreimage1 ),
860- TapPreimage2 : commitment .HexTapscriptSibling (t , p .TapPreimage2 ),
861- Bip86 : p .Bip86 ,
869+ TapPreimage1 : commitment .HexTapscriptSibling (
870+ t , p .TapPreimage1 ,
871+ ),
872+ TapPreimage2 : commitment .HexTapscriptSibling (
873+ t , p .TapPreimage2 ,
874+ ),
875+ Bip86 : p .Bip86 ,
876+ UnknownOddTypes : p .UnknownOddTypes ,
862877 }
863878}
864879
865880type TestTapscriptProof struct {
866- TapPreimage1 string `json:"tap_preimage_1"`
867- TapPreimage2 string `json:"tap_preimage_2"`
868- Bip86 bool `json:"bip86"`
881+ TapPreimage1 string `json:"tap_preimage_1"`
882+ TapPreimage2 string `json:"tap_preimage_2"`
883+ Bip86 bool `json:"bip86"`
884+ UnknownOddTypes tlv.TypeMap `json:"unknown_odd_types"`
869885}
870886
871887func (ttp * TestTapscriptProof ) ToTapscriptProof (t testing.TB ) * TapscriptProof {
@@ -878,22 +894,25 @@ func (ttp *TestTapscriptProof) ToTapscriptProof(t testing.TB) *TapscriptProof {
878894 TapPreimage2 : commitment .ParseTapscriptSibling (
879895 t , ttp .TapPreimage2 ,
880896 ),
881- Bip86 : ttp .Bip86 ,
897+ Bip86 : ttp .Bip86 ,
898+ UnknownOddTypes : ttp .UnknownOddTypes ,
882899 }
883900}
884901
885902func NewTestFromMetaReveal (t testing.TB , m * MetaReveal ) * TestMetaReveal {
886903 t .Helper ()
887904
888905 return & TestMetaReveal {
889- Type : uint8 (m .Type ),
890- Data : hex .EncodeToString (m .Data ),
906+ Type : uint8 (m .Type ),
907+ Data : hex .EncodeToString (m .Data ),
908+ UnknownOddTypes : m .UnknownOddTypes ,
891909 }
892910}
893911
894912type TestMetaReveal struct {
895- Type uint8 `json:"type"`
896- Data string `json:"data"`
913+ Type uint8 `json:"type"`
914+ Data string `json:"data"`
915+ UnknownOddTypes tlv.TypeMap `json:"unknown_odd_types"`
897916}
898917
899918func (tmr * TestMetaReveal ) ToMetaReveal (t testing.TB ) * MetaReveal {
@@ -903,7 +922,8 @@ func (tmr *TestMetaReveal) ToMetaReveal(t testing.TB) *MetaReveal {
903922 require .NoError (t , err )
904923
905924 return & MetaReveal {
906- Type : MetaType (tmr .Type ),
907- Data : data ,
925+ Type : MetaType (tmr .Type ),
926+ Data : data ,
927+ UnknownOddTypes : tmr .UnknownOddTypes ,
908928 }
909929}
0 commit comments