@@ -656,6 +656,43 @@ func TestSplitCommitment(t *testing.T) {
656656 },
657657 err : nil ,
658658 },
659+ {
660+ name : "single input split commitment lock time input" ,
661+ f : func () (* asset.Asset , * SplitLocator ,
662+ []* SplitLocator ) {
663+
664+ input := randAsset (
665+ t , genesisNormal , groupKeyNormal ,
666+ )
667+ input .Amount = 3
668+ input .RelativeLockTime = 1
669+ input .LockTime = 1
670+
671+ root := & SplitLocator {
672+ OutputIndex : 0 ,
673+ AssetID : genesisNormal .ID (),
674+ ScriptKey : asset .ToSerialized (
675+ input .ScriptKey .PubKey ,
676+ ),
677+ Amount : 1 ,
678+ }
679+ external := []* SplitLocator {{
680+ OutputIndex : 1 ,
681+ AssetID : genesisNormal .ID (),
682+ ScriptKey : asset .RandSerializedKey (t ),
683+ Amount : 1 ,
684+ }, {
685+
686+ OutputIndex : 2 ,
687+ AssetID : genesisNormal .ID (),
688+ ScriptKey : asset .RandSerializedKey (t ),
689+ Amount : 1 ,
690+ }}
691+
692+ return input , root , external
693+ },
694+ err : nil ,
695+ },
659696 {
660697 name : "no external splits" ,
661698 f : func () (* asset.Asset , * SplitLocator , []* SplitLocator ) {
@@ -871,6 +908,11 @@ func TestSplitCommitment(t *testing.T) {
871908 require .Contains (t , split .SplitAssets , * l )
872909 splitAsset := split .SplitAssets [* l ]
873910
911+ // Make sure that the splits don't inherit lock
912+ // time information from the root asset.
913+ require .Zero (t , splitAsset .LockTime )
914+ require .Zero (t , splitAsset .RelativeLockTime )
915+
874916 // If this is a leaf split, then we need to
875917 // ensure that the prev ID is zero.
876918 if splitAsset .SplitCommitmentRoot == nil {
0 commit comments