Documentation
¶
Index ¶
- Constants
- Variables
- func NameBaseCost(name, data string) uint64
- func NameCostPerBlock(baseCost uint64) uint64
- func NewGoWireCodec() *goWireCodec
- func TxHash(chainID string, tx Tx) []byte
- type BondTx
- func (tx *BondTx) AddInput(st state.AccountGetter, pubkey acm.PublicKey, amt uint64) error
- func (tx *BondTx) AddInputWithSequence(pubkey acm.PublicKey, amt uint64, sequence uint64) error
- func (tx *BondTx) AddOutput(addr acm.Address, amt uint64) error
- func (tx *BondTx) GetInputs() []TxInput
- func (tx *BondTx) Hash(chainID string) []byte
- func (tx *BondTx) Sign(chainID string, signingAccounts ...acm.AddressableSigner) error
- func (tx *BondTx) String() string
- func (tx *BondTx) WriteSignBytes(chainID string, w io.Writer, n *int, err *error)
- type CallTx
- type Decoder
- type Encoder
- type ErrTxInvalidSequence
- type ErrTxInvalidString
- type NameTx
- func (tx *NameTx) GetInputs() []TxInput
- func (tx *NameTx) Hash(chainID string) []byte
- func (tx *NameTx) Sign(chainID string, signingAccounts ...acm.AddressableSigner) error
- func (tx *NameTx) String() string
- func (tx *NameTx) ValidateStrings() error
- func (tx *NameTx) WriteSignBytes(chainID string, w io.Writer, n *int, err *error)
- type PermissionsTx
- func (tx *PermissionsTx) GetInputs() []TxInput
- func (tx *PermissionsTx) Hash(chainID string) []byte
- func (tx *PermissionsTx) Sign(chainID string, signingAccounts ...acm.AddressableSigner) error
- func (tx *PermissionsTx) String() string
- func (tx *PermissionsTx) WriteSignBytes(chainID string, w io.Writer, n *int, err *error)
- type RebondTx
- type Receipt
- type SendTx
- func (tx *SendTx) AddInput(st state.AccountGetter, pubkey acm.PublicKey, amt uint64) error
- func (tx *SendTx) AddInputWithSequence(pubkey acm.PublicKey, amt uint64, sequence uint64) error
- func (tx *SendTx) AddOutput(addr acm.Address, amt uint64) error
- func (tx *SendTx) GetInputs() []TxInput
- func (tx *SendTx) Hash(chainID string) []byte
- func (tx *SendTx) Sign(chainID string, signingAccounts ...acm.AddressableSigner) error
- func (tx *SendTx) String() string
- func (tx *SendTx) WriteSignBytes(chainID string, w io.Writer, n *int, err *error)
- type Tx
- type TxInput
- type TxOutput
- type UnbondTx
- type Wrapper
Constants ¶
View Source
const ( // Account transactions TxTypeSend = byte(0x01) TxTypeCall = byte(0x02) TxTypeName = byte(0x03) // Validation transactions TxTypeBond = byte(0x11) TxTypeUnbond = byte(0x12) TxTypeRebond = byte(0x13) // Admin transactions TxTypePermissions = byte(0x1f) )
Types of Tx implementations
Variables ¶
View Source
var ( MinNameRegistrationPeriod uint64 = 5 // cost for storing a name for a block is // CostPerBlock*CostPerByte*(len(data) + 32) NameByteCostMultiplier uint64 = 1 NameBlockCostMultiplier uint64 = 1 MaxNameLength = 64 MaxDataLength = 1 << 16 )
View Source
var ( ErrTxInvalidAddress = errors.New("error invalid address") ErrTxDuplicateAddress = errors.New("error duplicate address") ErrTxInvalidAmount = errors.New("error invalid amount") ErrTxInsufficientFunds = errors.New("error insufficient funds") ErrTxUnknownPubKey = errors.New("error unknown pubkey") ErrTxInvalidPubKey = errors.New("error invalid pubkey") ErrTxInvalidSignature = errors.New("error invalid signature") )
Functions ¶
func NameBaseCost ¶
base cost is "effective" number of bytes
func NameCostPerBlock ¶
func NewGoWireCodec ¶ added in v0.18.0
func NewGoWireCodec() *goWireCodec
Types ¶
type BondTx ¶
type BondTx struct {
PubKey acm.PublicKey
Signature acm.Signature
Inputs []*TxInput
UnbondTo []*TxOutput
// contains filtered or unexported fields
}
func (*BondTx) AddInputWithSequence ¶ added in v0.18.0
type CallTx ¶
type CallTx struct {
Input *TxInput
// Pointer since CallTx defines unset 'to' address as inducing account creation
Address *acm.Address
GasLimit uint64
Fee uint64
Data []byte
// contains filtered or unexported fields
}
func NewCallTxWithSequence ¶ added in v0.18.0
type ErrTxInvalidSequence ¶
func (ErrTxInvalidSequence) Error ¶
func (e ErrTxInvalidSequence) Error() string
type ErrTxInvalidString ¶
type ErrTxInvalidString struct {
Msg string
}
func (ErrTxInvalidString) Error ¶
func (e ErrTxInvalidString) Error() string
type NameTx ¶
type NameTx struct {
Input *TxInput
Name string
Data string
Fee uint64
// contains filtered or unexported fields
}
func NewNameTxWithSequence ¶ added in v0.18.0
func (*NameTx) Sign ¶
func (tx *NameTx) Sign(chainID string, signingAccounts ...acm.AddressableSigner) error
func (*NameTx) ValidateStrings ¶
type PermissionsTx ¶
type PermissionsTx struct {
Input *TxInput
PermArgs snatives.PermArgs
// contains filtered or unexported fields
}
func NewPermissionsTx ¶
func NewPermissionsTx(st state.AccountGetter, from acm.PublicKey, args snatives.PermArgs) (*PermissionsTx, error)
func NewPermissionsTxWithSequence ¶ added in v0.18.0
func (*PermissionsTx) GetInputs ¶ added in v0.18.0
func (tx *PermissionsTx) GetInputs() []TxInput
func (*PermissionsTx) Hash ¶ added in v0.18.0
func (tx *PermissionsTx) Hash(chainID string) []byte
func (*PermissionsTx) Sign ¶
func (tx *PermissionsTx) Sign(chainID string, signingAccounts ...acm.AddressableSigner) error
func (*PermissionsTx) String ¶
func (tx *PermissionsTx) String() string
func (*PermissionsTx) WriteSignBytes ¶
type RebondTx ¶
type RebondTx struct {
Address acm.Address
Height int
Signature acm.Signature
// contains filtered or unexported fields
}
type SendTx ¶
type SendTx struct {
Inputs []*TxInput
Outputs []*TxOutput
// contains filtered or unexported fields
}
func (*SendTx) AddInputWithSequence ¶ added in v0.18.0
type Tx ¶
type Tx interface {
WriteSignBytes(chainID string, w io.Writer, n *int, err *error)
String() string
GetInputs() []TxInput
Hash(chainID string) []byte
Sign(chainID string, signingAccounts ...acm.AddressableSigner) error
}
TODO: replace with sum-type struct like ResultEvent
type TxInput ¶
type TxInput struct {
Address acm.Address
Amount uint64
Sequence uint64
Signature acm.Signature
PublicKey acm.PublicKey
}
func (*TxInput) ValidateBasic ¶
type TxOutput ¶
func (*TxOutput) ValidateBasic ¶
type UnbondTx ¶
type UnbondTx struct {
Address acm.Address
Height int
Signature acm.Signature
// contains filtered or unexported fields
}
type Wrapper ¶ added in v0.18.0
type Wrapper struct {
Tx `json:"unwrap"`
}
func (Wrapper) MarshalJSON ¶ added in v0.18.0
func (*Wrapper) UnmarshalJSON ¶ added in v0.18.0
Click to show internal directories.
Click to hide internal directories.