Skip to content

Commit 3909a99

Browse files
committed
itest: update ListBatches calls
1 parent 434b33a commit 3909a99

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

itest/assertions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ func WaitForBatchState(t *testing.T, ctx context.Context,
331331
len(batchResp.Batches))
332332
}
333333

334-
if batchResp.Batches[0].State != targetState {
334+
if batchResp.Batches[0].Batch.State != targetState {
335335
return fmt.Errorf("expected batch state %v, got %v",
336-
targetState, batchResp.Batches[0].State)
336+
targetState, batchResp.Batches[0].Batch.State)
337337
}
338338

339339
return nil

itest/assets_test.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,18 +290,20 @@ func testMintAssetNameCollisionError(t *harnessTest) {
290290
allBatches := rpcBatches.Batches
291291
require.Len(t.t, allBatches, 2)
292292

293-
isCollidingBatch := func(batch *mintrpc.MintingBatch) bool {
294-
if len(batch.Assets) == 0 {
293+
isCollidingBatch := func(batch *mintrpc.VerboseBatch) bool {
294+
if len(batch.Batch.Assets) == 0 {
295295
return false
296296
}
297297

298-
return batch.Assets[0].AssetType == taprpc.AssetType_COLLECTIBLE
298+
assetType := batch.Batch.Assets[0].AssetType
299+
300+
return assetType == taprpc.AssetType_COLLECTIBLE
299301
}
300302
batchCollide, err := fn.First(allBatches, isCollidingBatch)
301303
require.NoError(t.t, err)
302304

303-
require.Len(t.t, batchCollide.Assets, 1)
304-
equalityCheck(assetCollide.Asset, batchCollide.Assets[0])
305+
require.Len(t.t, batchCollide.Batch.Assets, 1)
306+
equalityCheck(assetCollide.Asset, batchCollide.Batch.Assets[0])
305307

306308
cancelBatchKey, err := t.tapd.CancelBatch(
307309
ctxt, &mintrpc.CancelBatchRequest{},
@@ -323,11 +325,12 @@ func testMintAssetNameCollisionError(t *harnessTest) {
323325

324326
require.Len(t.t, cancelBatch.Batches, 1)
325327
cancelBatchCollide := cancelBatch.Batches[0]
326-
require.Len(t.t, cancelBatchCollide.Assets, 1)
328+
require.Len(t.t, cancelBatchCollide.Batch.Assets, 1)
327329
equalityCheckSeedlings(
328-
batchCollide.Assets[0], cancelBatchCollide.Assets[0],
330+
batchCollide.Batch.Assets[0],
331+
cancelBatchCollide.Batch.Assets[0],
329332
)
330-
cancelBatchState := cancelBatchCollide.State
333+
cancelBatchState := cancelBatchCollide.Batch.State
331334
require.Equal(
332335
t.t, cancelBatchState,
333336
mintrpc.BatchState_BATCH_STATE_SEEDLING_CANCELLED,

itest/multisig.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/davecgh/go-spew/spew"
1818
"github.com/decred/dcrd/dcrec/secp256k1/v4"
1919
"github.com/lightninglabs/lndclient"
20-
tap "github.com/lightninglabs/taproot-assets"
2120
"github.com/lightninglabs/taproot-assets/asset"
2221
"github.com/lightninglabs/taproot-assets/commitment"
2322
"github.com/lightninglabs/taproot-assets/fn"
@@ -171,7 +170,7 @@ func MultiSigTest(t *testing.T, ctx context.Context, aliceTapd,
171170
muSig2Addr, err := bobTapd.NewAddr(ctxt, &taprpc.NewAddrRequest{
172171
AssetId: firstBatchGenesis.AssetId,
173172
Amt: assetsToSend,
174-
ScriptKey: tap.MarshalScriptKey(tapScriptKey),
173+
ScriptKey: taprpc.MarshalScriptKey(tapScriptKey),
175174
InternalKey: &taprpc.KeyDescriptor{
176175
RawKeyBytes: pubKeyBytes(btcInternalKey),
177176
},
@@ -372,7 +371,7 @@ func DeriveKeys(t *testing.T, tapd TapdClient) (asset.ScriptKey,
372371
},
373372
)
374373
require.NoError(t, err)
375-
scriptKey, err := tap.UnmarshalScriptKey(scriptKeyDesc.ScriptKey)
374+
scriptKey, err := taprpc.UnmarshalScriptKey(scriptKeyDesc.ScriptKey)
376375
require.NoError(t, err)
377376

378377
internalKeyDesc, err := tapd.NextInternalKey(
@@ -381,7 +380,7 @@ func DeriveKeys(t *testing.T, tapd TapdClient) (asset.ScriptKey,
381380
},
382381
)
383382
require.NoError(t, err)
384-
internalKeyLnd, err := tap.UnmarshalKeyDescriptor(
383+
internalKeyLnd, err := taprpc.UnmarshalKeyDescriptor(
385384
internalKeyDesc.InternalKey,
386385
)
387386
require.NoError(t, err)

itest/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func MintAssetsConfirmBatch(t *testing.T, minerClient *rpcclient.Client,
421421
require.Len(t, batchResp.Batches, 1)
422422

423423
batch := batchResp.Batches[0]
424-
require.NotEmpty(t, batch.BatchTxid)
424+
require.NotEmpty(t, batch.Batch.BatchTxid)
425425

426426
return AssertAssetsMinted(
427427
t, tapClient, assetRequests, mintTXID, blockHash,

0 commit comments

Comments
 (0)