codes

package
v0.0.0-...-9f124b0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package codes is a helper package to help convert to transaction and operation result codes to strings used in horizon.

Index

Constants

View Source
const (
	// OpSuccess is the string code used to specify the operation was successful
	OpSuccess = "op_success"
	// OpMalformed is the string code used to specify the operation was malformed
	// in some way.
	OpMalformed = "op_malformed"
	// OpUnderfunded is the string code used to specify the operation failed
	// due to a lack of funds.
	OpUnderfunded = "op_underfunded"

	// OpLowReserve is the string code used to specify the operation failed
	// because the account in question does not have enough balance to satisfy
	// what their new minimum balance would be.
	OpLowReserve = "op_low_reserve"

	// OpLineFull occurs when a payment would cause a destination account to
	// exceed their declared trust limit for the asset being sent.
	OpLineFull = "op_line_full"

	// OpNoIssuer occurs when a operation does not correctly specify an issuing
	// asset
	OpNoIssuer = "op_no_issuer"
)

Variables

View Source
var ErrUnknownCode = errors.New("Unknown result code")

ErrUnknownCode is returned when an unexepcted value is provided to `String`

Functions

func ForOperationResult

func ForOperationResult(opr xdr.OperationResult) (string, error)

ForOperationResult returns the strong represtation used by horizon for the error code `opr`

func String

func String(code interface{}) (string, error)

String returns the appropriate string representation of the provided result code

Types

This section is empty.

Jump to

Keyboard shortcuts

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