Documentation ¶
Index ¶
- func AddressToKey(addr sdk.Address) []byte
- func GetTxDecoder(cdc *wire.Codec) func([]byte) (sdk.Tx, sdk.Error)
- func NewAnteHandler(am AccountMapper) sdk.AnteHandler
- func NewHandler(am AccountMapper) sdk.Handler
- func RegisterCodec(cdc *wire.Codec) *wire.Codec
- func WithSigners(ctx sdk.Context, account BaseAccount) sdk.Context
- type AccountMapper
- func (am AccountMapper) GetAccount(ctx sdk.Context, addr sdk.Address) BaseAccount
- func (am AccountMapper) GetNonce(ctx sdk.Context, addr sdk.Address) (int64, sdk.Error)
- func (am AccountMapper) GetPubKey(ctx sdk.Context, addr sdk.Address) (types.PubKey, sdk.Error)
- func (am AccountMapper) NewAccountWithAddress(ctx sdk.Context, addr sdk.Address) BaseAccount
- func (am AccountMapper) SetAccount(ctx sdk.Context, acc BaseAccount)
- func (am AccountMapper) SetNonce(ctx sdk.Context, addr sdk.Address, newNonce int64) sdk.Error
- type AuthSig
- type AuthTx
- type BaseAccount
- type MsgNonce
- type SHRAccount
- func (acc SHRAccount) GetAddress() sdk.Address
- func (acc SHRAccount) GetCoins() types.Coins
- func (acc SHRAccount) GetNonce() int64
- func (acc SHRAccount) GetPubKey() types.PubKey
- func (acc *SHRAccount) IncreaseNonce()
- func (acc *SHRAccount) SetAddress(addr sdk.Address) error
- func (acc *SHRAccount) SetCoins(c types.Coins)
- func (acc *SHRAccount) SetNonce(no int64) error
- func (acc *SHRAccount) SetPubKey(pk types.PubKey) error
- func (acc SHRAccount) String() string
- type SHRAccountJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressToKey ¶
func GetTxDecoder ¶
JSON decode MsgSend.
func NewAnteHandler ¶
func NewAnteHandler(am AccountMapper) sdk.AnteHandler
func NewHandler ¶
func NewHandler(am AccountMapper) sdk.Handler
func WithSigners ¶
func WithSigners(ctx sdk.Context, account BaseAccount) sdk.Context
WithSigners add the signer to the context
Types ¶
type AccountMapper ¶
type AccountMapper struct {
// contains filtered or unexported fields
}
AccountMapper handles logic of account encode/decode
func NewAccountMapper ¶
func NewAccountMapper(cdc *wire.Codec, key sdk.StoreKey, proto BaseAccount) AccountMapper
NewAccountMapper returns a new sdk.AccountMapper
func (AccountMapper) GetAccount ¶
func (am AccountMapper) GetAccount(ctx sdk.Context, addr sdk.Address) BaseAccount
Implements BaseAccount
func (AccountMapper) NewAccountWithAddress ¶
func (am AccountMapper) NewAccountWithAddress(ctx sdk.Context, addr sdk.Address) BaseAccount
NewAccountWithAddress
func (AccountMapper) SetAccount ¶
func (am AccountMapper) SetAccount(ctx sdk.Context, acc BaseAccount)
type AuthSig ¶
type AuthTx ¶
func (AuthTx) GetSignBytes ¶
GetSignBytes returns Bytes to be signed
func (AuthTx) GetSignature ¶
func (tx AuthTx) GetSignature() types.SHRSignature
GetSignature returns the signature with this transaction
func (AuthTx) VerifySignature ¶
VerifySignature to verify signature
type BaseAccount ¶
type BaseAccount interface { types.Account GetAddress() sdk.Address SetAddress(sdk.Address) error // errors if already set GetPubKey() types.PubKey // can return nil SetPubKey(types.PubKey) error GetNonce() int64 SetNonce(int64) error IncreaseNonce() String() string }
BaseAccount is an interface providing sequence number to avoid replay attack and public key for authentication
type MsgNonce ¶
func NewMsgNonce ¶
func (MsgNonce) GetSignBytes ¶
func (MsgNonce) GetSigners ¶
func (MsgNonce) ValidateBasic ¶
type SHRAccount ¶
type SHRAccount struct { Address sdk.Address `json:"address"` Coins types.Coins `json:"coins"` PubKey types.PubKey `json:"pub_key"` Nonce int64 `json:"nonce"` }
SHRAccount - a ShareLedger account
func NewSHRAccountWithAddress ¶
func NewSHRAccountWithAddress(addr sdk.Address) *SHRAccount
NewSHRAccountWithAddress create a SHRAccount with address
func (SHRAccount) GetAddress ¶
func (acc SHRAccount) GetAddress() sdk.Address
func (SHRAccount) GetCoins ¶
func (acc SHRAccount) GetCoins() types.Coins
func (SHRAccount) GetNonce ¶
func (acc SHRAccount) GetNonce() int64
func (SHRAccount) GetPubKey ¶
func (acc SHRAccount) GetPubKey() types.PubKey
func (*SHRAccount) IncreaseNonce ¶
func (acc *SHRAccount) IncreaseNonce()
func (*SHRAccount) SetAddress ¶
func (acc *SHRAccount) SetAddress(addr sdk.Address) error
func (*SHRAccount) SetCoins ¶
func (acc *SHRAccount) SetCoins(c types.Coins)
func (*SHRAccount) SetNonce ¶
func (acc *SHRAccount) SetNonce(no int64) error
func (SHRAccount) String ¶
func (acc SHRAccount) String() string
Click to show internal directories.
Click to hide internal directories.