@@ -280,7 +280,6 @@ func TestImportAssetProof(t *testing.T) {
280280
281281 // Add a random asset and corresponding proof into the database.
282282 testAsset , testProof := dbHandle .AddRandomAssetProof (t )
283- assetID := testAsset .ID ()
284283 initialBlob := testProof .Blob
285284
286285 // We should now be able to retrieve the set of all assets inserted on
@@ -313,11 +312,8 @@ func TestImportAssetProof(t *testing.T) {
313312 // We should also be able to fetch the created asset above based on
314313 // either the asset ID, or key group via the main coin selection
315314 // routine.
316- var assetConstraints tapfreighter.CommitmentConstraints
317- if testAsset .GroupKey != nil {
318- assetConstraints .GroupKey = & testAsset .GroupKey .GroupPubKey
319- } else {
320- assetConstraints .AssetID = & assetID
315+ assetConstraints := tapfreighter.CommitmentConstraints {
316+ AssetSpecifier : testAsset .Specifier (),
321317 }
322318 selectedAssets , err := assetStore .ListEligibleCoins (
323319 ctxb , assetConstraints ,
@@ -659,16 +655,20 @@ func (a *assetGenerator) genAssets(t *testing.T, assetStore *AssetStore,
659655 }
660656}
661657
662- func (a * assetGenerator ) bindAssetID (i int , op wire.OutPoint ) * asset.ID {
658+ func (a * assetGenerator ) assetSpecifierAssetID (i int ,
659+ op wire.OutPoint ) asset.Specifier {
660+
663661 gen := a .assetGens [i ]
664662 gen .FirstPrevOut = op
665663
666664 id := gen .ID ()
667665
668- return & id
666+ return asset . NewSpecifierFromId ( id )
669667}
670668
671- func (a * assetGenerator ) bindGroupKey (i int , op wire.OutPoint ) * btcec.PublicKey {
669+ func (a * assetGenerator ) assetSpecifierGroupKey (i int ,
670+ op wire.OutPoint ) asset.Specifier {
671+
672672 gen := a .assetGens [i ]
673673 gen .FirstPrevOut = op
674674 genTweak := gen .ID ()
@@ -677,8 +677,9 @@ func (a *assetGenerator) bindGroupKey(i int, op wire.OutPoint) *btcec.PublicKey
677677
678678 internalPriv := input .TweakPrivKey (& groupPriv , genTweak [:])
679679 tweakedPriv := txscript .TweakTaprootPrivKey (* internalPriv , nil )
680+ groupPubKey := tweakedPriv .PubKey ()
680681
681- return tweakedPriv . PubKey ( )
682+ return asset . NewSpecifierFromGroupKey ( * groupPubKey )
682683}
683684
684685// TestFetchAllAssets tests that the different AssetQueryFilters work as
@@ -1000,7 +1001,7 @@ func TestSelectCommitment(t *testing.T) {
10001001 },
10011002 },
10021003 constraints : tapfreighter.CommitmentConstraints {
1003- AssetID : assetGen .bindAssetID (
1004+ AssetSpecifier : assetGen .assetSpecifierAssetID (
10041005 0 , assetGen .anchorPoints [0 ],
10051006 ),
10061007 MinAmt : 2 ,
@@ -1022,7 +1023,7 @@ func TestSelectCommitment(t *testing.T) {
10221023 },
10231024 },
10241025 constraints : tapfreighter.CommitmentConstraints {
1025- AssetID : assetGen .bindAssetID (
1026+ AssetSpecifier : assetGen .assetSpecifierAssetID (
10261027 0 , assetGen .anchorPoints [0 ],
10271028 ),
10281029 MinAmt : 10 ,
@@ -1043,7 +1044,7 @@ func TestSelectCommitment(t *testing.T) {
10431044 },
10441045 },
10451046 constraints : tapfreighter.CommitmentConstraints {
1046- AssetID : assetGen .bindAssetID (
1047+ AssetSpecifier : assetGen .assetSpecifierAssetID (
10471048 1 , assetGen .anchorPoints [1 ],
10481049 ),
10491050 MinAmt : 10 ,
@@ -1074,7 +1075,7 @@ func TestSelectCommitment(t *testing.T) {
10741075 },
10751076 },
10761077 constraints : tapfreighter.CommitmentConstraints {
1077- GroupKey : assetGen .bindGroupKey (
1078+ AssetSpecifier : assetGen .assetSpecifierGroupKey (
10781079 0 , assetGen .anchorPoints [0 ],
10791080 ),
10801081 MinAmt : 1 ,
@@ -1104,7 +1105,7 @@ func TestSelectCommitment(t *testing.T) {
11041105 },
11051106 },
11061107 constraints : tapfreighter.CommitmentConstraints {
1107- AssetID : assetGen .bindAssetID (
1108+ AssetSpecifier : assetGen .assetSpecifierAssetID (
11081109 0 , assetGen .anchorPoints [0 ],
11091110 ),
11101111 MinAmt : 2 ,
@@ -1146,7 +1147,7 @@ func TestSelectCommitment(t *testing.T) {
11461147 },
11471148 },
11481149 constraints : tapfreighter.CommitmentConstraints {
1149- GroupKey : assetGen .bindGroupKey (
1150+ AssetSpecifier : assetGen .assetSpecifierGroupKey (
11501151 0 , assetGen .anchorPoints [0 ],
11511152 ),
11521153 MinAmt : 1 ,
0 commit comments