Skip to content

Commit

Permalink
tapdb: multiverse sums issuance universe leaves as 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ffranr committed Oct 12, 2023
1 parent 3080658 commit 0211bf5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tapdb/multiverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ func (b *MultiverseStore) UpsertProofLeaf(ctx context.Context,
universeRootHash := universeRoot.NodeHash()
assetGroupSum := universeRoot.NodeSum()

if id.ProofType == universe.ProofTypeIssuance {
assetGroupSum = 1
}

leafNode := mssmt.NewLeafNode(
universeRootHash[:], assetGroupSum,
)
Expand Down Expand Up @@ -334,6 +338,10 @@ func (b *MultiverseStore) RegisterBatchIssuance(ctx context.Context,
universeRootHash := universeRoot.NodeHash()
assetGroupSum := universeRoot.NodeSum()

if item.ID.ProofType == universe.ProofTypeIssuance {
assetGroupSum = 1
}

leafNode := mssmt.NewLeafNode(
universeRootHash[:], assetGroupSum,
)
Expand Down

0 comments on commit 0211bf5

Please sign in to comment.