Documentation ¶
Index ¶
- Constants
- func ErrInvalidAddress(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidDenom(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidFee(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidIOF(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidOIndex(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidTransaction(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidUTXO(codespace sdk.CodespaceType, msg string) sdk.Error
- func MakeCodec() *amino.Codec
- func NewSpendHandler(um Mapper, nextPos NextPosition) sdk.Handler
- func RegisterAmino(cdc *amino.Codec)
- func SetupMultiStore() (sdk.MultiStore, *sdk.KVStoreKey, *sdk.KVStoreKey)
- type FeeUpdater
- type Input
- type Mapper
- type NextPosition
- type Output
- type Position
- type ProtoPosition
- type SpendMsg
- type UTXO
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = 2 CodeInvalidAddress sdk.CodeType = 101 CodeInvalidOIndex sdk.CodeType = 102 CodeInvalidDenomination sdk.CodeType = 103 CodeInvalidIOF sdk.CodeType = 104 CodeInvalidUTXO sdk.CodeType = 105 CodeInvalidTransaction sdk.CodeType = 106 CodeInvalidFee sdk.CodeType = 107 )
Reserve errors 100 ~ 199
Variables ¶
This section is empty.
Functions ¶
func ErrInvalidAddress ¶
func ErrInvalidAddress(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidDenom ¶
func ErrInvalidDenom(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidFee ¶
func ErrInvalidFee(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidIOF ¶
func ErrInvalidIOF(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidOIndex ¶
func ErrInvalidOIndex(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidTransaction ¶
func ErrInvalidTransaction(codespace sdk.CodespaceType, msg string) sdk.Error
---------------------------------------- Error constructors
func ErrInvalidUTXO ¶
func ErrInvalidUTXO(codespace sdk.CodespaceType, msg string) sdk.Error
func NewSpendHandler ¶
func NewSpendHandler(um Mapper, nextPos NextPosition) sdk.Handler
Handler handles spends of arbitrary utxo implementation
func RegisterAmino ¶
func RegisterAmino(cdc *amino.Codec)
func SetupMultiStore ¶
func SetupMultiStore() (sdk.MultiStore, *sdk.KVStoreKey, *sdk.KVStoreKey)
Types ¶
type Mapper ¶
type Mapper interface { GetUTXO(ctx sdk.Context, addr []byte, position Position) UTXO ConstructKey(addr []byte, position Position) []byte ReceiveUTXO(sdk.Context, UTXO) ValidateUTXO(sdk.Context, UTXO) sdk.Error InvalidateUTXO(sdk.Context, UTXO) SpendUTXO(ctx sdk.Context, addr []byte, position Position) sdk.Error }
Mapper stores and retrieves UTXO's from stores retrieved from the context.
type NextPosition ¶
Return the next position for handler to store newly created UTXOs Secondary is true if NextPosition is meant to return secondary output positions for a single multioutput transaction If false, NextPosition will increment position to accomadate outputs for a new transaction
type Position ¶
type Position interface { // Position is a uint slice Get() []sdk.Uint // get position int slice. Return nil if unset. // returns true if the position is valid, false otherwise IsValid() bool }
Positions must be unqiue or a collision may result when using mapper.go
type ProtoPosition ¶
type ProtoPosition func() Position
Create a prototype Position. Must return pointer to struct implementing Position
type SpendMsg ¶
SpendMsg is an interface that wraps sdk.Msg with additional information for the UTXO spend handler.