Skip to content

Commit 3f53f04

Browse files
committed
rpc: update ListBatches
1 parent 08e0ea2 commit 3f53f04

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

rpcserver.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -654,15 +654,19 @@ func (r *rpcServer) ListBatches(_ context.Context,
654654
}
655655
}
656656

657-
batches, err := r.cfg.AssetMinter.ListBatches(batchKey)
657+
batches, err := r.cfg.AssetMinter.ListBatches(
658+
tapgarden.ListBatchesParams{
659+
BatchKey: batchKey,
660+
},
661+
)
658662
if err != nil {
659663
return nil, fmt.Errorf("unable to list batches: %w", err)
660664
}
661665

662666
rpcBatches, err := fn.MapErr(
663-
batches,
664-
func(b *tapgarden.MintingBatch) (*mintrpc.MintingBatch, error) {
665-
return marshalMintingBatch(b, false)
667+
batches, func(b *tapgarden.VerboseBatch) (*mintrpc.MintingBatch,
668+
error) {
669+
return marshalMintingBatch(b.ToMintingBatch(), false)
666670
},
667671
)
668672
if err != nil {
@@ -3489,7 +3493,7 @@ func marshalSprouts(sprouts []*asset.Asset,
34893493
}
34903494

34913495
// marshalBatchState converts the batch state field into its RPC counterpart.
3492-
func marshalBatchState(batch *tapgarden.MintingBatch) (mintrpc.BatchState,
3496+
func marshalBatchState[T tapgarden.MinterBatch](batch T) (mintrpc.BatchState,
34933497
error) {
34943498

34953499
currentBatchState := batch.State()

0 commit comments

Comments
 (0)