Skip to content

Commit 9668caa

Browse files
committed
tapdb: add initial implementation of universe.IgnoreTree
1 parent 9cb1e09 commit 9668caa

File tree

9 files changed

+849
-2
lines changed

9 files changed

+849
-2
lines changed

asset/asset.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,18 @@ func (s *Specifier) UnwrapGroupKeyToPtr() *btcec.PublicKey {
449449
return s.groupKey.UnwrapToPtr()
450450
}
451451

452+
// UnwrapGroupKeyOrErr unwraps the group public key field or returns an error if
453+
// it is not specified.
454+
func (s *Specifier) UnwrapGroupKeyOrErr() (*btcec.PublicKey, error) {
455+
groupKey := s.groupKey.UnwrapToPtr()
456+
if groupKey == nil {
457+
return nil, fmt.Errorf("unable to unwrap asset group public " +
458+
"key")
459+
}
460+
461+
return groupKey, nil
462+
}
463+
452464
// UnwrapToPtr unwraps the asset ID and asset group public key fields,
453465
// returning them as pointers.
454466
func (s *Specifier) UnwrapToPtr() (*ID, *btcec.PublicKey) {

tapdb/assets_common.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ type UpsertAssetStore interface {
5050
FetchGenesisID(ctx context.Context,
5151
arg sqlc.FetchGenesisIDParams) (int64, error)
5252

53+
// FetchGenesisIDByAssetID fetches the database ID of an asset genesis
54+
// by its asset ID.
55+
FetchGenesisIDByAssetID(ctx context.Context,
56+
assetID []byte) (int64, error)
57+
5358
// FetchScriptKeyIDByTweakedKey determines the database ID of a script
5459
// key by querying it by the tweaked key.
5560
FetchScriptKeyIDByTweakedKey(ctx context.Context,

0 commit comments

Comments
 (0)