@@ -216,7 +216,7 @@ type ActiveAssetsStore interface {
216216 // disk.
217217 FetchAssetProofs (ctx context.Context ) ([]AssetProof , error )
218218
219- // FetchAssetsProofsSizes fetches all the asset proofs lengths that are
219+ // FetchAssetProofsSizes fetches all the asset proofs lengths that are
220220 // stored on disk.
221221 FetchAssetProofsSizes (ctx context.Context ) ([]AssetProofSize , error )
222222
@@ -353,16 +353,6 @@ type ActiveAssetsStore interface {
353353 // the passed params.
354354 ReAnchorPassiveAssets (ctx context.Context , arg ReAnchorParams ) error
355355
356- // FetchAssetMetaByHash fetches the asset meta for a given meta hash.
357- //
358- // TODO(roasbeef): split into MetaStore?
359- FetchAssetMetaByHash (ctx context.Context ,
360- metaDataHash []byte ) (sqlc.FetchAssetMetaByHashRow , error )
361-
362- // FetchAssetMetaForAsset fetches the asset meta for a given asset.
363- FetchAssetMetaForAsset (ctx context.Context ,
364- assetID []byte ) (sqlc.FetchAssetMetaForAssetRow , error )
365-
366356 // InsertBurn inserts a new row to the asset burns table which
367357 // includes all important data related to the burn.
368358 InsertBurn (ctx context.Context , arg sqlc.InsertBurnParams ) (int64 ,
@@ -376,12 +366,12 @@ type ActiveAssetsStore interface {
376366// MetaStore is a sub-set of the main sqlc.Querier interface that contains
377367// methods related to metadata of the daemon.
378368type MetaStore interface {
379- // AssetsDBSize returns the total size of the taproot assets sqlite
380- // database.
369+ // AssetsDBSizeSqlite returns the total size of the taproot assets
370+ // sqlite database.
381371 AssetsDBSizeSqlite (ctx context.Context ) (int32 , error )
382372
383- // AssetsDBSize returns the total size of the taproot assets postgres
384- // database.
373+ // AssetsDBSizePostgres returns the total size of the taproot assets
374+ // postgres database.
385375 AssetsDBSizePostgres (ctx context.Context ) (int64 , error )
386376}
387377
@@ -3419,40 +3409,6 @@ func (a *AssetStore) QueryParcels(ctx context.Context,
34193409 return outboundParcels , nil
34203410}
34213411
3422- // ErrAssetMetaNotFound is returned when an asset meta is not found in the
3423- // database.
3424- var ErrAssetMetaNotFound = fmt .Errorf ("asset meta not found" )
3425-
3426- // FetchAssetMetaForAsset attempts to fetch an asset meta based on an asset ID.
3427- func (a * AssetStore ) FetchAssetMetaForAsset (ctx context.Context ,
3428- assetID asset.ID ) (* proof.MetaReveal , error ) {
3429-
3430- var assetMeta * proof.MetaReveal
3431-
3432- readOpts := NewAssetStoreReadTx ()
3433- dbErr := a .db .ExecTx (ctx , & readOpts , func (q ActiveAssetsStore ) error {
3434- dbMeta , err := q .FetchAssetMetaForAsset (ctx , assetID [:])
3435- if err != nil {
3436- return err
3437- }
3438-
3439- assetMeta = & proof.MetaReveal {
3440- Data : dbMeta .MetaDataBlob ,
3441- Type : proof .MetaType (dbMeta .MetaDataType .Int16 ),
3442- }
3443-
3444- return nil
3445- })
3446- switch {
3447- case errors .Is (dbErr , sql .ErrNoRows ):
3448- return nil , ErrAssetMetaNotFound
3449- case dbErr != nil :
3450- return nil , dbErr
3451- }
3452-
3453- return assetMeta , nil
3454- }
3455-
34563412// AssetsDBSize returns the total size of the taproot assets database.
34573413func (a * AssetStore ) AssetsDBSize (ctx context.Context ) (int64 , error ) {
34583414 var totalSize int64
@@ -3492,36 +3448,6 @@ func (a *AssetStore) AssetsDBSize(ctx context.Context) (int64, error) {
34923448 return totalSize , nil
34933449}
34943450
3495- // FetchAssetMetaByHash attempts to fetch an asset meta based on an asset hash.
3496- func (a * AssetStore ) FetchAssetMetaByHash (ctx context.Context ,
3497- metaHash [asset .MetaHashLen ]byte ) (* proof.MetaReveal , error ) {
3498-
3499- var assetMeta * proof.MetaReveal
3500-
3501- readOpts := NewAssetStoreReadTx ()
3502- dbErr := a .db .ExecTx (ctx , & readOpts , func (q ActiveAssetsStore ) error {
3503- dbMeta , err := q .FetchAssetMetaByHash (ctx , metaHash [:])
3504- if err != nil {
3505- return err
3506- }
3507-
3508- assetMeta = & proof.MetaReveal {
3509- Data : dbMeta .MetaDataBlob ,
3510- Type : proof .MetaType (dbMeta .MetaDataType .Int16 ),
3511- }
3512-
3513- return nil
3514- })
3515- switch {
3516- case errors .Is (dbErr , sql .ErrNoRows ):
3517- return nil , ErrAssetMetaNotFound
3518- case dbErr != nil :
3519- return nil , dbErr
3520- }
3521-
3522- return assetMeta , nil
3523- }
3524-
35253451// TxHeight returns the block height of a given transaction. This will only
35263452// return the height if the transaction is known to the store, which is only
35273453// the case for assets relevant to this node.
0 commit comments