Documentation
¶
Index ¶
- Variables
- type Configuration
- type Validator
- func (v *Validator) Account(account identifier.Account) (flow.Address, error)
- func (v *Validator) Block(rosBlockID identifier.Block) (uint64, flow.Identifier, error)
- func (v *Validator) CompleteBlockID(rosBlockID identifier.Block) error
- func (v *Validator) Currency(currency identifier.Currency) (string, uint, error)
- func (v *Validator) Request(request interface{}) error
- func (v *Validator) Transaction(transaction identifier.Transaction) (flow.Identifier, error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidValidation = errors.New("invalid validation input")
ErrInvalidValidation is a sentinel error for any error not being caused by a given input failing validation.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶ added in v1.3.4
type Configuration interface {
Check(identifier.Network) error
}
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates Rosetta object identifiers.
func (*Validator) Account ¶
Account validates the given account identifier, and if successful, returns a matching Flow Address.
func (*Validator) Block ¶
func (v *Validator) Block(rosBlockID identifier.Block) (uint64, flow.Identifier, error)
Block tries to extrapolate the block identifier to a full version of itself. If both index and hash are zero values, it is assumed that the latest block is referenced.
func (*Validator) CompleteBlockID ¶ added in v1.3.0
func (v *Validator) CompleteBlockID(rosBlockID identifier.Block) error
CompleteBlockID verifies that both index and hash are populated in the block ID.
func (*Validator) Currency ¶
Currency validates the given currency identifier and if it is, returns its symbol and decimals.
func (*Validator) Request ¶ added in v1.3.0
Request runs the registered validators on the provided request. It either returns a typed error with contextual information, or a plain error describing what failed.
func (*Validator) Transaction ¶
func (v *Validator) Transaction(transaction identifier.Transaction) (flow.Identifier, error)
Transaction validates a transaction identifier, and if its valid, returns a matching Flow Identifier.