Versions in this module Expand all Collapse all v0 v0.7.0 Nov 27, 2020 Changes in this version + const AnyAmountSign + const NegativeAmountSign + const PositiveAmountSign + var ErrAccountMatchAccountMissing = errors.New("account is missing") + var ErrAccountMatchSubAccountMissing = errors.New("SubAccountIdentifier.Address is missing") + var ErrAccountMatchSubAccountPopulated = errors.New("SubAccount is populated") + var ErrAccountMatchUnexpectedSubAccountAddr = errors.New("unexpected SubAccountIdentifier.Address") + var ErrAmountMatchAmountMissing = errors.New("amount is missing") + var ErrAmountMatchAmountPopulated = errors.New("amount is populated") + var ErrAmountMatchUnexpectedCurrency = errors.New("unexpected currency") + var ErrAmountMatchUnexpectedSign = errors.New("unexpected amount sign") + var ErrCoinActionMatchCoinChangeIsNil = errors.New("coin change is nil") + var ErrCoinActionMatchUnexpectedCoinAction = errors.New("unexpected coin action") + var ErrEqualAddressesAccountIsNil = errors.New("account is nil") + var ErrEqualAddressesAddrMismatch = errors.New("addresses do not match") + var ErrEqualAddressesTooFewOperations = errors.New("cannot check equality of <= 1 operations") + var ErrEqualAmountsNoOperations = errors.New("cannot check equality of 0 operations") + var ErrEqualAmountsNotEqual = errors.New("amounts are not equal") + var ErrExpectedOperationAccountMismatch = errors.New("intended account did not match observed account") + var ErrExpectedOperationAmountMismatch = errors.New("intended amount did not match observed amount") + var ErrExpectedOperationTypeMismatch = errors.New("intended type did not match observed type") + var ErrExpectedOperationsExtraOperation = errors.New("found extra operation") + var ErrExpectedSignerMissing = errors.New("missing expected signer") + var ErrExpectedSignerUnexpectedSigner = errors.New("found unexpected signers") + var ErrMatchIndexValidIndexIsNil = errors.New("match index is nil") + var ErrMatchIndexValidIndexOutOfRange = errors.New("match index out of range") + var ErrMatchOperationsDescriptionNotMatched = errors.New("could not find match for description") + var ErrMatchOperationsDescriptionsMissing = errors.New("no descriptions to match") + var ErrMatchOperationsMatchNotFound = errors.New("unable to find match for operation") + var ErrMatchOperationsNoOperations = errors.New("unable to match anything to 0 operations") + var ErrMetadataMatchKeyNotFound = errors.New("key is not present in metadata") + var ErrMetadataMatchKeyValueMismatch = errors.New("unexpected value associated with key") + var ErrOppositeAmountsAbsValMismatch = errors.New("operation absolute values are not equal") + var ErrOppositeAmountsSameSign = errors.New("operations have the same sign") + var IntentErrs = []error + var MatchOpsErrs = []error + func Err(err error) (bool, string) + func ExpectedOperation(intent *types.Operation, observed *types.Operation) error + func ExpectedSigners(intent []*types.SigningPayload, observed []*types.AccountIdentifier) error + func MatchBalanceExemption(matchedExemptions []*types.BalanceExemption, difference string) *types.BalanceExemption + type AccountDescription struct + Exists bool + SubAccountAddress string + SubAccountExists bool + SubAccountMetadataKeys []*MetadataDescription + type AmountDescription struct + Currency *types.Currency + Exists bool + Sign AmountSign + type AmountSign int + func (s AmountSign) Match(amount *types.Amount) bool + func (s AmountSign) String() string + type BalanceChange struct + Account *types.AccountIdentifier + Block *types.BlockIdentifier + Currency *types.Currency + Difference string + type Descriptions struct + EqualAddresses [][]int + EqualAmounts [][]int + ErrUnmatched bool + OperationDescriptions []*OperationDescription + OppositeAmounts [][]int + type ExemptOperation func(*types.Operation) bool + type Match struct + Amounts []*big.Int + Operations []*types.Operation + func MatchOperations(descriptions *Descriptions, operations []*types.Operation) ([]*Match, error) + func (m *Match) First() (*types.Operation, *big.Int) + type MetadataDescription struct + Key string + ValueKind reflect.Kind + type OperationDescription struct + Account *AccountDescription + AllowRepeats bool + Amount *AmountDescription + CoinAction types.CoinAction + Metadata []*MetadataDescription + Optional bool + Type string + type OperationGroup struct + Currencies []*types.Currency + NilAmountPresent bool + Operations []*types.Operation + Type string + func GroupOperations(transaction *types.Transaction) []*OperationGroup + type Parser struct + Asserter *asserter.Asserter + BalanceExemptions []*types.BalanceExemption + ExemptFunc ExemptOperation + func New(asserter *asserter.Asserter, exemptFunc ExemptOperation, ...) *Parser + func (p *Parser) BalanceChanges(ctx context.Context, block *types.Block, blockRemoved bool) ([]*BalanceChange, error) + func (p *Parser) ExpectedOperations(intent []*types.Operation, observed []*types.Operation, errExtra bool, ...) error + func (p *Parser) FindExemptions(account *types.AccountIdentifier, currency *types.Currency) []*types.BalanceExemption