Skip to content

Commit aadd2fe

Browse files
committed
asset: add asset specifier method to Asset type
This commit adds a new method called `Specifier` to the `Asset` type. This method returns the asset specifier for the given asset instance.
1 parent a03717f commit aadd2fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

asset/asset.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,6 +2011,12 @@ func (a *Asset) Leaf() (*mssmt.LeafNode, error) {
20112011
return mssmt.NewLeafNode(buf.Bytes(), a.Amount), nil
20122012
}
20132013

2014+
// Specifier returns the asset's specifier.
2015+
func (a *Asset) Specifier() Specifier {
2016+
id := a.Genesis.ID()
2017+
return NewSpecifierOptionalGroupKey(id, a.GroupKey)
2018+
}
2019+
20142020
// Validate ensures that an asset is valid.
20152021
func (a *Asset) Validate() error {
20162022
// TODO(ffranr): Add validation check for remaining fields.

0 commit comments

Comments
 (0)