Skip to content

Commit 1af522d

Browse files
committed
universe: rename withBaseUni to withUni for broader use
Renamed withBaseUni to withUni to enable use with universes of any proof type, including both issuance and transfer proofs.
1 parent e0631a9 commit 1af522d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

universe/archive.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,13 @@ type uniFetcher interface {
110110
// something to it, returning a type T and an error.
111111
type uniAction[T any] func(BaseBackend) (T, error)
112112

113-
// withBaseUni is a helper function for performing some action on/with a base
114-
// universe with a generic return value.
115-
func withBaseUni[T any](fetcher uniFetcher, id Identifier,
113+
// withUni is a helper function that performs an action on a universe instance,
114+
// returning a generic result.
115+
func withUni[T any](fetcher uniFetcher, id Identifier,
116116
f uniAction[T]) (T, error) {
117117

118-
baseUni := fetcher.fetchUniverse(id)
119-
120-
return f(baseUni)
118+
uni := fetcher.fetchUniverse(id)
119+
return f(uni)
121120
}
122121

123122
// RootNode returns the root node of the base universe corresponding to the
@@ -705,7 +704,7 @@ func (a *Archive) MintingLeaves(ctx context.Context,
705704
log.Debugf("Retrieving all leaves for Universe: id=%v",
706705
id.StringForLog())
707706

708-
return withBaseUni(
707+
return withUni(
709708
a, id, func(baseUni BaseBackend) ([]Leaf, error) {
710709
return baseUni.MintingLeaves(ctx)
711710
},

0 commit comments

Comments
 (0)