@@ -422,10 +422,16 @@ func TestUniverseTreeIsolation(t *testing.T) {
422422
423423 // For this test, we'll create two different Universes: one based on a
424424 // group key, and the other with a plain asset ID.
425- idGroup := randUniverseID (t , true )
425+ //
426+ // One will be an issuance tree, while the other a transfer tree.
427+ idGroup := randUniverseID (
428+ t , true , withProofType (universe .ProofTypeIssuance ),
429+ )
426430 groupUniverse , _ := newTestUniverseWithDb (db .BaseDB , idGroup )
427431
428- idNormal := randUniverseID (t , false )
432+ idNormal := randUniverseID (
433+ t , false , withProofType (universe .ProofTypeTransfer ),
434+ )
429435 normalUniverse , _ := newTestUniverseWithDb (db .BaseDB , idNormal )
430436
431437 // For each of the Universes, we'll now insert a random leaf that
@@ -473,6 +479,30 @@ func TestUniverseTreeIsolation(t *testing.T) {
473479 return false
474480 }))
475481
482+ // Similarly, each of the roots should have the proper proof type set.
483+ require .True (t , fn .All (rootNodes , func (root universe.BaseRoot ) bool {
484+ switch root .ID .ProofType {
485+ case universe .ProofTypeIssuance :
486+ return mssmt .IsEqualNode (root .Node , groupRoot )
487+ case universe .ProofTypeTransfer :
488+ return mssmt .IsEqualNode (root .Node , normalRoot )
489+ default :
490+ return false
491+ }
492+ }))
493+
494+ // Finally, the grouped root should have the GroupedAssets field
495+ // properly set.
496+ for _ , root := range rootNodes {
497+ if mssmt .IsEqualNode (root .Node , groupRoot ) {
498+ require .True (t , len (root .GroupedAssets ) != 0 )
499+
500+ groupAmt , ok := root .GroupedAssets [groupLeaf .Leaf .ID ()]
501+ require .True (t , ok )
502+ require .Equal (t , groupLeaf .Leaf .Amt , groupAmt )
503+ }
504+ }
505+
476506 // We should be able to delete one Universe with no effect on the other.
477507 normalNamespace , err := normalUniverse .DeleteUniverse (ctx )
478508 require .NoError (t , err )
0 commit comments