Documentation ¶
Index ¶
- Constants
- func AccOutLabel(accOut AccOutput) string
- func AccOutNode(g *dot.Graph, accOut AccOutput) dot.Node
- func GenTxHash(cdc *codec.Codec, tx Tx) []byte
- func GetOutPointKey(op OutPoint) string
- func GetTxOutValue(outputs []TxOut) uint64
- func GetTxSignature(cdc *codec.Codec, tx Tx, name string) ([]byte, error)
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterCodec(cdc *codec.Codec)
- func SortTxInputs(tx *Tx)
- func SortTxOutputs(tx *Tx)
- func TxInLabel(txIn TxIn) string
- func TxInNodeID(txID Hash, in TxIn) string
- func TxNode(g *dot.Graph, txNodeID Hash, tx Tx) dot.Node
- func TxNodeLabel(txID Hash) string
- func TxOutLabel(txOutIndex int, txOut TxOut) string
- func UnspentOutputNode(g *dot.Graph, utxo OutPoint) dot.Node
- type AccOutput
- type Hash
- type Keeper
- func (k Keeper) DeleteOutPoint(ctx sdk.Context, outpoint OutPoint)
- func (k Keeper) GetAccOutput(ctx sdk.Context, id Hash) AccOutput
- func (k Keeper) GetTx(ctx sdk.Context, hash Hash) Tx
- func (k Keeper) HasAccOutput(ctx sdk.Context, id Hash) bool
- func (k Keeper) HasOutPoint(ctx sdk.Context, outpoint OutPoint) bool
- func (k Keeper) HasTx(ctx sdk.Context, hash Hash) bool
- func (k Keeper) ListAccOutput(ctx sdk.Context) []AccOutput
- func (k Keeper) ListTx(ctx sdk.Context) ([]Tx, []Hash)
- func (k Keeper) ListUtxo(ctx sdk.Context) []OutPoint
- func (k Keeper) PutAccOutput(ctx sdk.Context, accUtxo AccOutput)
- func (k Keeper) PutOutPoint(ctx sdk.Context, outpoint OutPoint)
- func (k Keeper) PutTx(ctx sdk.Context, hash Hash, tx Tx)
- type MsgBirthAccOutput
- type MsgTx
- type OutPoint
- type OutPointVal
- type PayToAddress
- type Tx
- type TxIn
- type TxOut
- type Wallet
Constants ¶
const ( ListAccOutput = "ls-account-outputs" ListUtxo = "ls" ListTx = "ls-tx" GetTx = "get-tx" GetBalance = "balance" GetGraph = "graph" )
Endpoints supported by the Querier.
const LabelLength int = 8
LabelLength is leading number of chars from the hash used in the dot graph.
const OutPointAccountBirth = -1
OutPointAccountBirth indicates Hash refers to an account based output birth record.
Variables ¶
This section is empty.
Functions ¶
func AccOutLabel ¶
AccOutLabel returns the label for an account output.
func AccOutNode ¶
AccOutNode creates a node for an account output.
func GetOutPointKey ¶
GetOutPointKey returns the key used in the KVStore for the given OutPoint.
func GetTxOutValue ¶
GetTxOutValue returns the sum of the output values.
func GetTxSignature ¶
GetTxSignature returns a cryptographic signature for a transaction.
func NewHandler ¶
NewHandler returns a handler for "utxo" type messages.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec.
func SortTxInputs ¶
func SortTxInputs(tx *Tx)
SortTxInputs sorts transaction inputs (canonical ordering).
func SortTxOutputs ¶
func SortTxOutputs(tx *Tx)
SortTxOutputs sorts transaction outputs (canonical ordering).
func TxInNodeID ¶
TxInNodeID generates a dot graph ID for a Tx input.
func TxNodeLabel ¶
TxNodeLabel returns the node label for a transaction.
func TxOutLabel ¶
TxOutLabel returns the label for a transaction output.
Types ¶
type AccOutput ¶
type AccOutput struct { ID Hash Value uint64 Address sdk.AccAddress Block int64 }
AccOutput represents an account based output birth record.
func GenAccOutput ¶
GenAccOutput creates an AccOutput from MsgBirthAccOutput info.
type Hash ¶
type Hash []byte
Hash represents a transaction or account output ID.
func (Hash) MarshalJSON ¶
MarshalJSON marshals to JSON using Bech32.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine.
func NewKeeper ¶
func NewKeeper(accountKeeper auth.AccountKeeper, coinKeeper bank.Keeper, accUtxoStoreKey sdk.StoreKey, utxoStoreKey sdk.StoreKey, txStoreKey sdk.StoreKey, cdc *codec.Codec) Keeper
NewKeeper creates new instances of the UTXO Keeper.
func (Keeper) DeleteOutPoint ¶
DeleteOutPoint deletes the given outpoint from the UTXO list.
func (Keeper) GetAccOutput ¶
GetAccOutput - gets a AccOutput from the store.
func (Keeper) HasAccOutput ¶
HasAccOutput - checks if an account output by the given ID exists.
func (Keeper) HasOutPoint ¶
HasOutPoint checks if the given outpoint exists in the UTXO list.
func (Keeper) ListAccOutput ¶
ListAccOutput - get all account UTXO records.
func (Keeper) PutAccOutput ¶
PutAccOutput - saves an account UTXO to the store.
func (Keeper) PutOutPoint ¶
PutOutPoint saves an outpoint to the UTXO store.
type MsgBirthAccOutput ¶
type MsgBirthAccOutput struct { Amount sdk.Coin Address sdk.AccAddress }
MsgBirthAccOutput defines a BirthAccOutput message.
func NewMsgBirthAccOutput ¶
func NewMsgBirthAccOutput(amount sdk.Coin, address sdk.AccAddress) MsgBirthAccOutput
NewMsgBirthAccOutput is the constructor function for MsgBirthAccOutput.
func (MsgBirthAccOutput) GetSignBytes ¶
func (msg MsgBirthAccOutput) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgBirthAccOutput) GetSigners ¶
func (msg MsgBirthAccOutput) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgBirthAccOutput) ValidateBasic ¶
func (msg MsgBirthAccOutput) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgTx ¶
type MsgTx struct { Tx Tx Signer sdk.AccAddress }
MsgTx represents a UTXO based transaction.
func NewMsgTx ¶
func NewMsgTx(tx Tx, signer sdk.AccAddress) MsgTx
NewMsgTx creates a new transaction message.
func (MsgTx) ValidateBasic ¶
ValidateBasic Implements Msg.
type OutPoint ¶
OutPoint identifies an output from a previous transaction by index. Index >= 0 indicates Hash is a transaction ID. Index = -1 indicates Hash refers to an account based output birth record. Index = -2 indicates Hash refers to a voucher based output birth record.
type OutPointVal ¶
OutPointVal is an outpoint and it's value.
type PayToAddress ¶
type PayToAddress struct {
Address sdk.AccAddress
}
PayToAddress indicates the UTXO is payable to an address.
type Tx ¶
Tx represents a transaction.
func NewTxPayToAddress ¶
func NewTxPayToAddress(cdc *codec.Codec, sig []byte, hash []byte, index int32, amount uint64, change uint64, from sdk.AccAddress, to sdk.AccAddress) Tx
NewTxPayToAddress creates a transaction payload to pay to an address.
type TxOut ¶
TxOut represents a transaction output. PkScript is the go-amino binary marshalled PayTo* struct.
type Wallet ¶
type Wallet struct { Balance uint64 Entries []OutPointVal }
Wallet represents a balance and UTXOs for an address.