Skip to content

Commit c5bd0cc

Browse files
committed
itest: assert multiverse roots
1 parent aab22c2 commit c5bd0cc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

itest/universe_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,35 @@ func testUniverseSync(t *harnessTest) {
261261
require.True(
262262
t.t, AssertUniverseRootsEqual(universeRoots, universeRootsBob),
263263
)
264+
265+
// Test the multiverse root is equal for both nodes.
266+
multiverseRootAlice, err := t.tapd.MultiverseRoot(
267+
ctxt, &unirpc.MultiverseRootRequest{
268+
ProofType: unirpc.ProofType_PROOF_TYPE_ISSUANCE,
269+
},
270+
)
271+
require.NoError(t.t, err)
272+
273+
// For Bob we query with the actual IDs of the universe we are aware of.
274+
multiverseRootBob, err := bob.MultiverseRoot(
275+
ctxt, &unirpc.MultiverseRootRequest{
276+
ProofType: unirpc.ProofType_PROOF_TYPE_ISSUANCE,
277+
SpecificIds: uniIDs,
278+
},
279+
)
280+
require.NoError(t.t, err)
281+
282+
require.Equal(
283+
t.t, multiverseRootAlice.MultiverseRoot.RootHash,
284+
multiverseRootBob.MultiverseRoot.RootHash,
285+
)
286+
287+
// We also expect the proof's root hash to be equal to the actual
288+
// multiverse root.
289+
require.Equal(
290+
t.t, firstAssetUniProof.MultiverseRoot.RootHash,
291+
multiverseRootBob.MultiverseRoot.RootHash,
292+
)
264293
}
265294

266295
// unmarshalMerkleSumNode un-marshals a protobuf MerkleSumNode.

0 commit comments

Comments
 (0)