Skip to content

Commit 7400499

Browse files
committed
tapdb: format and reflow comments
1 parent a51aaa4 commit 7400499

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

tapdb/universe.go

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,16 @@ func (b *BaseUniverseTree) RegisterIssuance(ctx context.Context,
340340
// broader DB updates.
341341
func universeUpsertProofLeaf(ctx context.Context, dbTx BaseUniverseStore,
342342
id universe.Identifier, key universe.LeafKey, leaf *universe.Leaf,
343-
metaReveal *proof.MetaReveal,
344-
) (*universe.Proof, mssmt.Node, error) {
343+
metaReveal *proof.MetaReveal) (*universe.Proof, mssmt.Node, error) {
345344

346345
namespace := id.String()
347346

348347
// With the tree store created, we'll now obtain byte representation of
349348
// the minting key, as that'll be the key in the SMT itself.
350349
smtKey := key.UniverseKey()
351350

352-
// The value stored in the MS-SMT will be the serialized Leaf,
353-
// so we'll convert that into raw bytes now.
351+
// The value stored in the MS-SMT will be the serialized Leaf, so we'll
352+
// convert that into raw bytes now.
354353
leafNode := leaf.SmtLeafNode()
355354

356355
var groupKeyBytes []byte
@@ -368,23 +367,21 @@ func universeUpsertProofLeaf(ctx context.Context, dbTx BaseUniverseStore,
368367
universeRoot mssmt.Node
369368
)
370369

371-
// First, we'll instantiate a new compact tree instance from the
372-
// backing tree store.
370+
// First, we'll instantiate a new compact tree instance from the backing
371+
// tree store.
373372
universeTree := mssmt.NewCompactedTree(
374373
newTreeStoreWrapperTx(dbTx, namespace),
375374
)
376375

377-
// Now that we have a tree instance linked to this DB
378-
// transaction, we'll insert the leaf into the tree based on
379-
// its SMT key.
376+
// Now that we have a tree instance linked to this DB transaction, we'll
377+
// insert the leaf into the tree based on its SMT key.
380378
_, err = universeTree.Insert(ctx, smtKey, leafNode)
381379
if err != nil {
382380
return nil, nil, err
383381
}
384382

385-
// Next, we'll upsert the universe root in the DB, which gives
386-
// us the root ID that we'll use to insert the universe leaf
387-
// overlay.
383+
// Next, we'll upsert the universe root in the DB, which gives us the
384+
// root ID that we'll use to insert the universe leaf overlay.
388385
universeRootID, err := dbTx.UpsertUniverseRoot(ctx, NewUniverseRoot{
389386
NamespaceRoot: namespace,
390387
AssetID: fn.ByteSlice(leaf.ID()),
@@ -395,9 +392,9 @@ func universeUpsertProofLeaf(ctx context.Context, dbTx BaseUniverseStore,
395392
return nil, nil, err
396393
}
397394

398-
// Before we insert the asset genesis, we'll insert the meta
399-
// first. The reveal may or may not be populated, which'll also
400-
// insert the opaque meta blob on disk.
395+
// Before we insert the asset genesis, we'll insert the meta first. The
396+
// reveal may or may not be populated, which'll also insert the opaque
397+
// meta blob on disk.
401398
_, err = maybeUpsertAssetMeta(ctx, dbTx, &leaf.Genesis, metaReveal)
402399
if err != nil {
403400
return nil, nil, err
@@ -429,8 +426,8 @@ func universeUpsertProofLeaf(ctx context.Context, dbTx BaseUniverseStore,
429426
return nil, nil, err
430427
}
431428

432-
// Finally, we'll obtain the merkle proof from the tree for the
433-
// leaf we just inserted.
429+
// Finally, we'll obtain the merkle proof from the tree for the leaf we
430+
// just inserted.
434431
leafInclusionProof, err = universeTree.MerkleProof(ctx, smtKey)
435432
if err != nil {
436433
return nil, nil, err

0 commit comments

Comments
 (0)