Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksService ¶
type ChecksService struct {
// contains filtered or unexported fields
}
func NewChecksService ¶
func NewChecksService(checkers []NamedChecker) *ChecksService
type DefaultCheckers ¶
type DefaultCheckers struct {
// contains filtered or unexported fields
}
func (*DefaultCheckers) CheckTokenSpendability ¶
func (a *DefaultCheckers) CheckTokenSpendability(ctx context.Context) ([]string, error)
CheckTokenSpendability checks that for each unspent token, it is still spendable. Spendability is verified against the current TMS for the given TMS ID. A token is still spendable if: - The token type is among the supported; - The token is parsable; - The token's recipients are still valid.
func (*DefaultCheckers) CheckTransactions ¶
func (a *DefaultCheckers) CheckTransactions(ctx context.Context) ([]string, error)
CheckTransactions checks that for each transaction stored in the local database, the status of this transaction matches the status of the transaction on the ledger.
func (*DefaultCheckers) CheckUnspentTokens ¶
func (a *DefaultCheckers) CheckUnspentTokens(ctx context.Context) ([]string, error)
CheckUnspentTokens checks that for each unspent token, the content of the local database matches the ledger
type NamedChecker ¶
func NewDefaultCheckers ¶
func NewDefaultCheckers(tmsProvider TokenManagementServiceProvider, networkProvider NetworkProvider, db TokenTransactionDB, tokenDB *tokens.Service, tmsID token.TMSID) []NamedChecker
type NetworkProvider ¶
type StatusEvent ¶
type StatusEvent struct {
Ctx context.Context
TxID string
ValidationCode driver.TxStatus
ValidationMessage string
}
StatusEvent models an event related to the status of a transaction
type StatusSupport ¶
type StatusSupport struct {
// contains filtered or unexported fields
}
func NewStatusSupport ¶
func NewStatusSupport() *StatusSupport
func (*StatusSupport) AddStatusListener ¶
func (c *StatusSupport) AddStatusListener(txID string, ch chan StatusEvent)
func (*StatusSupport) DeleteStatusListener ¶
func (c *StatusSupport) DeleteStatusListener(txID string, ch chan StatusEvent)
func (*StatusSupport) ListenerTxIDs ¶ added in v0.15.1
func (c *StatusSupport) ListenerTxIDs() []string
ListenerTxIDs returns the tx ids that currently have at least one registered status listener. Used by fallback pollers to scope batch status lookups to transactions someone is actually waiting on.
func (*StatusSupport) Notify ¶
func (c *StatusSupport) Notify(event StatusEvent)
type TokenManagementServiceProvider ¶
type TokenManagementServiceProvider interface {
GetManagementService(opts ...token.ServiceOption) (*token.ManagementService, error)
}
type TokenTransactionDB ¶
type TokenTransactionDB interface {
GetTokenRequest(ctx context.Context, txID string) ([]byte, error)
Transactions(ctx context.Context, params driver.QueryTransactionsParams, pagination driver2.Pagination) (*driver2.PageIterator[*driver.TransactionRecord], error)
}