failure

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Description

type Description struct {
	Text   string
	Fields Fields
}

Description is the description of a Rosetta API failure.

func NewDescription

func NewDescription(text string, fields ...FieldFunc) Description

NewDescription returns a new description from a given text and fields.

func (Description) String

func (d Description) String() string

String implements the Stringer interface.

type Field

type Field struct {
	Key string
	Val interface{}
}

Field is a key/value pair used to add context to a Description.

type FieldFunc

type FieldFunc func(*Fields)

FieldFunc is a function that is applied to a Fields pointer.

func WithErr

func WithErr(err error) FieldFunc

WithErr returns a function that adds an error value to a slice of Fields.

func WithID added in v1.1.0

func WithID(key string, val flow.Identifier) FieldFunc

WithID returns a function that adds a flow Identifier value to a slice of Fields.

func WithInt

func WithInt(key string, val int) FieldFunc

WithInt returns a function that adds an integer value to a slice of Fields.

func WithString

func WithString(key string, val string) FieldFunc

WithString returns a function that adds a string value to a slice of Fields.

func WithStrings

func WithStrings(key string, vals ...string) FieldFunc

WithStrings returns a function that adds a slice of strings to a slice of Fields.

func WithUint64

func WithUint64(key string, val uint64) FieldFunc

WithUint64 returns a function that adds an unsigned integer value to a slice of Fields.

type Fields

type Fields []Field

Fields is a slice of Field.

func (Fields) Iterate

func (f Fields) Iterate(handle func(key string, val interface{}))

Iterate is used to give external access to the fields to consumers of this package.

func (Fields) String

func (f Fields) String() string

String implements the Stringer interface.

type IncompleteBlock added in v1.3.4

type IncompleteBlock struct {
	Description Description
}

IncompleteBlock is the error for an incomplete block identifier, missing either the hash or the index.

func (IncompleteBlock) Error added in v1.3.4

func (i IncompleteBlock) Error() string

Error implements the error interface.

type InvalidAccount

type InvalidAccount struct {
	Description Description
	Address     string
}

InvalidAccount is the error for an account with an invalid identifier.

func (InvalidAccount) Error

func (i InvalidAccount) Error() string

Error implements the error interface.

type InvalidAccountAddress added in v1.3.4

type InvalidAccountAddress struct {
	Description Description
	WantLength  int
	HaveLength  int
}

InvalidAccountAddress is the error for an account address of invalid length.

func (InvalidAccountAddress) Error added in v1.3.4

func (i InvalidAccountAddress) Error() string

Error implements the error interface.

type InvalidAmount added in v1.2.0

type InvalidAmount struct {
	Description Description
	Amount      string
}

InvalidAmount is the error for an invalid transaction amount.

func (InvalidAmount) Error added in v1.2.0

func (i InvalidAmount) Error() string

Error implements the error interface.

type InvalidArguments added in v1.2.0

type InvalidArguments struct {
	Description Description
	Have        uint
	Want        uint
}

InvalidArguments is the error for an invalid number of arguments.

func (InvalidArguments) Error added in v1.2.0

func (i InvalidArguments) Error() string

Error implements the error interface.

type InvalidAuthorizers added in v1.2.0

type InvalidAuthorizers struct {
	Description Description
	Have        uint
	Want        uint
}

InvalidAuthorizers is the error for an invalid number of authorizers.

func (InvalidAuthorizers) Error added in v1.2.0

func (i InvalidAuthorizers) Error() string

Error implements the error interface.

type InvalidBlock

type InvalidBlock struct {
	Description Description
}

InvalidBlock is the error for block with an invalid identifier.

func (InvalidBlock) Error

func (i InvalidBlock) Error() string

Error implements the error interface.

type InvalidBlockHash added in v1.3.4

type InvalidBlockHash struct {
	Description Description
	WantLength  int
	HaveLength  int
}

InvalidBlockHash is the error for a block hash of invalid length.

func (InvalidBlockHash) Error added in v1.3.4

func (i InvalidBlockHash) Error() string

Error implements the error interface.

type InvalidBlockchain added in v1.3.4

type InvalidBlockchain struct {
	Description    Description
	HaveBlockchain string
	WantBlockchain string
}

func (InvalidBlockchain) Error added in v1.3.4

func (i InvalidBlockchain) Error() string

type InvalidCurrency

type InvalidCurrency struct {
	Description Description
	Symbol      string
	Decimals    uint
}

InvalidCurrency is the error for a currency with missing or unexpected decimals.

func (InvalidCurrency) Error

func (i InvalidCurrency) Error() string

Error implements the error interface.

type InvalidIntent added in v1.2.0

type InvalidIntent struct {
	Description Description
}

InvalidIntent is the error for an invalid transaction intent.

func (InvalidIntent) Error added in v1.2.0

func (i InvalidIntent) Error() string

Error implements the error interface.

type InvalidKey added in v1.2.0

type InvalidKey struct {
	Description Description
	Height      uint64
	Address     flow.Address
	Index       int
}

InvalidKey is the error for an invalid signer key.

func (InvalidKey) Error added in v1.2.0

func (i InvalidKey) Error() string

Error implements the error interface.

type InvalidNetwork

type InvalidNetwork struct {
	Description Description
	HaveNetwork string
	WantNetwork string
}

InvalidNetwork is the error for an invalid network identifier.

func (InvalidNetwork) Error

func (i InvalidNetwork) Error() string

Error implements the error interface.

type InvalidOperations added in v1.2.0

type InvalidOperations struct {
	Description Description
	Want        uint
	Have        uint
}

InvalidOperations is the error for an invalid set of operations.

func (InvalidOperations) Error added in v1.2.0

func (i InvalidOperations) Error() string

Error implements the error interface.

type InvalidPayer added in v1.2.0

type InvalidPayer struct {
	Description Description
	Have        flow.Address
	Want        flow.Address
}

InvalidPayer is the error for an invalid transaction payer.

func (InvalidPayer) Error added in v1.2.0

func (i InvalidPayer) Error() string

Error implements the error interface.

type InvalidPayload added in v1.2.0

type InvalidPayload struct {
	Description Description
	Encoding    string
}

InvalidPayload is the error for an invalid transaction payload encoding.

func (InvalidPayload) Error added in v1.2.0

func (i InvalidPayload) Error() string

Error implements the error interface.

type InvalidProposer added in v1.2.0

type InvalidProposer struct {
	Description Description
	Have        flow.Address
	Want        flow.Address
}

InvalidProposer is the error for an invalid transaction proposer.

func (InvalidProposer) Error added in v1.2.0

func (i InvalidProposer) Error() string

Error implements the error interface.

type InvalidReceiver added in v1.2.0

type InvalidReceiver struct {
	Description Description
	Receiver    string
}

InvalidReceiver is the error for an invalid transaction receiver address.

func (InvalidReceiver) Error added in v1.2.0

func (i InvalidReceiver) Error() string

Error implements the error interface.

type InvalidScript added in v1.2.0

type InvalidScript struct {
	Description Description
	Script      string
}

InvalidScript is the error for an invalid transaction script.

func (InvalidScript) Error added in v1.2.0

func (i InvalidScript) Error() string

Error implements the error interface.

type InvalidSignature added in v1.2.0

type InvalidSignature struct {
	Description Description
}

InvalidSignature is the error for an invalid transaction signature.

func (InvalidSignature) Error added in v1.2.0

func (i InvalidSignature) Error() string

Error implements the error interface.

type InvalidSignatures added in v1.2.0

type InvalidSignatures struct {
	Description Description
	Want        uint
	Have        uint
}

InvalidSignatures is the error for an invalid set of transaction signatures.

func (InvalidSignatures) Error added in v1.2.0

func (i InvalidSignatures) Error() string

Error implements the error interface.

type InvalidTransaction

type InvalidTransaction struct {
	Description Description
	Hash        string
}

InvalidTransaction is the error for an invalid transaction hash.

func (InvalidTransaction) Error

func (i InvalidTransaction) Error() string

Error implements the error interface.

type InvalidTransactionHash added in v1.3.4

type InvalidTransactionHash struct {
	Description Description
	WantLength  int
	HaveLength  int
}

InvalidTransactionHash is the error for an invalid transaction hash length.

func (InvalidTransactionHash) Error added in v1.3.4

func (i InvalidTransactionHash) Error() string

Error implements the error interface.

type UnknownBlock

type UnknownBlock struct {
	Description Description
	Index       uint64
	Hash        string
}

UnknownBlock is the error for an unknown block identifier.

func (UnknownBlock) Error

func (u UnknownBlock) Error() string

Error implements the error interface.

type UnknownCurrency

type UnknownCurrency struct {
	Description Description
	Symbol      string
	Decimals    uint
}

UnknownCurrency is the error for an unknown currency.

func (UnknownCurrency) Error

func (u UnknownCurrency) Error() string

Error implements the error interface.

type UnknownTransaction

type UnknownTransaction struct {
	Description Description
	Hash        string
}

UnknownTransaction is the error for an unknown transaction identifier.

func (UnknownTransaction) Error

func (u UnknownTransaction) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL