Skip to content

Commit 7269bb3

Browse files
committed
supplycommit: remove FetchCommitment from manager
Favor use of supplyverifier.Manager.FetchCommitment instead.
1 parent dc18c74 commit 7269bb3

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

universe/supplycommit/manager.go

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -497,55 +497,6 @@ type FetchCommitmentResp struct {
497497
ChainCommitment RootCommitment
498498
}
499499

500-
// FetchCommitment fetches the supply commitment for the given asset specifier.
501-
func (m *Manager) FetchCommitment(ctx context.Context,
502-
assetSpec asset.Specifier) (fn.Option[FetchCommitmentResp], error) {
503-
504-
var zero fn.Option[FetchCommitmentResp]
505-
506-
chainCommitOpt, err := m.cfg.Commitments.SupplyCommit(
507-
ctx, assetSpec,
508-
).Unpack()
509-
if err != nil {
510-
return zero, fmt.Errorf("unable to fetch supply commit: %w",
511-
err)
512-
}
513-
514-
if chainCommitOpt.IsNone() {
515-
// If the chain commitment is not present, we return an empty
516-
// response.
517-
return zero, nil
518-
}
519-
chainCommit, err := chainCommitOpt.UnwrapOrErr(
520-
fmt.Errorf("unable to fetch supply commit: %w", err),
521-
)
522-
if err != nil {
523-
return zero, err
524-
}
525-
526-
supplyTree, err := m.cfg.TreeView.FetchRootSupplyTree(
527-
ctx, assetSpec,
528-
).Unpack()
529-
if err != nil {
530-
return zero, fmt.Errorf("unable to fetch supply commit root "+
531-
"supply tree: %w", err)
532-
}
533-
534-
subtrees, err := m.cfg.TreeView.FetchSubTrees(
535-
ctx, assetSpec, fn.None[uint32](),
536-
).Unpack()
537-
if err != nil {
538-
return zero, fmt.Errorf("unable to fetch supply commit sub "+
539-
"trees: %w", err)
540-
}
541-
542-
return fn.Some(FetchCommitmentResp{
543-
SupplyTree: supplyTree,
544-
Subtrees: subtrees,
545-
ChainCommitment: chainCommit,
546-
}), nil
547-
}
548-
549500
// FetchSupplyLeavesByHeight returns the set of supply leaves for the given
550501
// asset specifier within the specified height range.
551502
func (m *Manager) FetchSupplyLeavesByHeight(

0 commit comments

Comments
 (0)