diff --git a/itest/assertions.go b/itest/assertions.go index a4d3e5a6d..c0b09dd0a 100644 --- a/itest/assertions.go +++ b/itest/assertions.go @@ -990,13 +990,15 @@ func AssertUniverseRootEquality(t *testing.T, )) } +// AssertUniverseRoot makes sure the given universe root exists with the given +// sum, either identified by the asset ID or group key. func AssertUniverseRoot(t *testing.T, client unirpc.UniverseClient, - sum int, assetID []byte, groupKey []byte) error { + sum int, assetID []byte, groupKey []byte) { bothSet := assetID != nil && groupKey != nil neitherSet := assetID == nil && groupKey == nil if bothSet || neitherSet { - return fmt.Errorf("only set one of assetID or groupKey") + t.Fatalf("only set one of assetID or groupKey") } // Re-parse and serialize the keys to account for the different @@ -1033,8 +1035,6 @@ func AssertUniverseRoot(t *testing.T, client unirpc.UniverseClient, correctRoot := fn.Any(maps.Values(uniRoots.UniverseRoots), matchingRoot) require.True(t, correctRoot) - - return nil } func AssertUniverseRootEqual(a, b *unirpc.UniverseRoot) bool { diff --git a/itest/loadtest/mint_batch_test.go b/itest/loadtest/mint_batch_test.go index a01ce6452..7803b4619 100644 --- a/itest/loadtest/mint_batch_test.go +++ b/itest/loadtest/mint_batch_test.go @@ -2,6 +2,7 @@ package loadtest import ( "context" + _ "embed" "encoding/binary" "encoding/hex" "fmt" @@ -10,8 +11,6 @@ import ( "testing" "time" - _ "embed" - "github.com/btcsuite/btcd/rpcclient" "github.com/lightninglabs/taproot-assets/fn" "github.com/lightninglabs/taproot-assets/itest" @@ -161,10 +160,7 @@ func mintBatchStressTest(t *testing.T, ctx context.Context, require.NoError(t, err) require.Len(t, uniRoots.UniverseRoots, groupCount) - err = itest.AssertUniverseRoot( - t, alice, groupBalance, nil, collectGroupKey, - ) - require.NoError(t, err) + itest.AssertUniverseRoot(t, alice, groupBalance, nil, collectGroupKey) // The universe tree should also have a leaf for each asset minted. // TODO(jhb): Resolve issue of 33-byte group key handling. diff --git a/itest/mint_batch_stress_test.go b/itest/mint_batch_stress_test.go index 2ee4d55b2..486ba52ad 100644 --- a/itest/mint_batch_stress_test.go +++ b/itest/mint_batch_stress_test.go @@ -183,10 +183,7 @@ func mintBatchStressTest( require.NoError(t, err) require.Len(t, uniRoots.UniverseRoots, groupCount) - err = AssertUniverseRoot( - t, alice, groupBalance, nil, collectGroupKey, - ) - require.NoError(t, err) + AssertUniverseRoot(t, alice, groupBalance, nil, collectGroupKey) // The universe tree should also have a leaf for each asset minted. // TODO(jhb): Resolve issue of 33-byte group key handling.