File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 55 "context"
66 "crypto/tls"
77 "net/http"
8+ "slices"
9+ "strings"
810 "time"
911
1012 "github.com/btcsuite/btcd/btcec/v2"
@@ -596,5 +598,22 @@ func testMintBatchAndTransfer(t *harnessTest) {
596598
597599 // The batch listed after the transfer should be identical to the batch
598600 // listed before the transfer.
599- require .True (t .t , proto .Equal (originalBatches , afterBatches ))
601+ require .Equal (
602+ t .t , len (originalBatches .Batches ), len (afterBatches .Batches ),
603+ )
604+
605+ originalBatch := originalBatches .Batches [0 ].Batch
606+ afterBatch := afterBatches .Batches [0 ].Batch
607+
608+ // Sort the assets from the listed batch before comparison.
609+ slices .SortFunc (originalBatch .Assets ,
610+ func (a , b * mintrpc.PendingAsset ) int {
611+ return strings .Compare (a .Name , b .Name )
612+ })
613+ slices .SortFunc (afterBatch .Assets ,
614+ func (a , b * mintrpc.PendingAsset ) int {
615+ return strings .Compare (a .Name , b .Name )
616+ })
617+
618+ require .True (t .t , proto .Equal (originalBatch , afterBatch ))
600619}
You can’t perform that action at this time.
0 commit comments