rosetta-lbry/indexer/coin_storage_helper.go
2020-10-27 10:02:28 -07:00

23 lines
603 B
Go

package indexer
import (
"context"
"github.com/coinbase/rosetta-sdk-go/storage"
"github.com/coinbase/rosetta-sdk-go/types"
)
var _ storage.CoinStorageHelper = (*CoinStorageHelper)(nil)
type CoinStorageHelper struct {
b *storage.BlockStorage
}
// CurrentBlockIdentifier returns the current head block identifier
// and is used to comply with the CoinStorageHelper interface.
func (h *CoinStorageHelper) CurrentBlockIdentifier(
ctx context.Context,
transaction storage.DatabaseTransaction,
) (*types.BlockIdentifier, error) {
return h.b.GetHeadBlockIdentifierTransactional(ctx, transaction)
}