File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,14 @@ type ManagedUTXO struct {
417417 // TapscriptSibling is the serialized tapscript sibling preimage of
418418 // this asset. This will usually be blank.
419419 TapscriptSibling []byte
420+
421+ // LeaseOwner is the identifier of the lease owner of this UTXO. If
422+ // blank, this UTXO isn't leased.
423+ LeaseOwner []byte
424+
425+ // LeaseExpiry is the expiry time of the lease on this UTXO. If the
426+ // zero, then this UTXO isn't leased.
427+ LeaseExpiry time.Time
420428}
421429
422430// AssetHumanReadable is a subset of the base asset struct that only includes
@@ -1125,7 +1133,7 @@ func (a *AssetStore) FetchManagedUTXOs(ctx context.Context) (
11251133 return nil , err
11261134 }
11271135
1128- managedUtxos [ i ] = & ManagedUTXO {
1136+ utxo : = & ManagedUTXO {
11291137 OutPoint : anchorPoint ,
11301138 OutputValue : btcutil .Amount (u .AmtSats ),
11311139 InternalKey : keychain.KeyDescriptor {
@@ -1140,7 +1148,13 @@ func (a *AssetStore) FetchManagedUTXOs(ctx context.Context) (
11401148 TaprootAssetRoot : u .TaprootAssetRoot ,
11411149 MerkleRoot : u .MerkleRoot ,
11421150 TapscriptSibling : u .TapscriptSibling ,
1151+ LeaseOwner : u .LeaseOwner ,
11431152 }
1153+ if u .LeaseExpiry .Valid {
1154+ utxo .LeaseExpiry = u .LeaseExpiry .Time
1155+ }
1156+
1157+ managedUtxos [i ] = utxo
11441158 }
11451159
11461160 return managedUtxos , nil
Original file line number Diff line number Diff line change @@ -1465,8 +1465,11 @@ func TestAssetExportLog(t *testing.T) {
14651465 require .NoError (t , err )
14661466 require .Len (t , utxos , 3 )
14671467
1468- // First UTXO should remain unchanged.
1468+ // First UTXO should remain unchanged. It should now have a lease
1469+ // expiry and owner set.
14691470 require .Equal (t , assetGen .anchorPoints [0 ], utxos [0 ].OutPoint )
1471+ require .Equal (t , leaseOwner [:], utxos [0 ].LeaseOwner [:])
1472+ require .NotZero (t , utxos [0 ].LeaseExpiry )
14701473
14711474 // Second UTXO will be our new one.
14721475 newUtxo := utxos [1 ]
You can’t perform that action at this time.
0 commit comments