Documentation ¶
Index ¶
- func NewAminoCodec() *aminoCodec
- func NewJSONCodec() *jsonCodec
- type Codec
- type Decoder
- type Encoder
- type Envelope
- type Receipt
- type Signatory
- type Tx
- func (tx *Tx) Enclose() *Envelope
- func (tx *Tx) GenerateReceipt() *Receipt
- func (tx *Tx) Hash() []byte
- func (tx *Tx) MarshalJSON() ([]byte, error)
- func (tx *Tx) MustSignBytes() []byte
- func (tx *Tx) Rehash() []byte
- func (tx *Tx) Sign(signingAccounts ...acm.AddressableSigner) (*Envelope, error)
- func (tx *Tx) SignBytes() ([]byte, error)
- func (tx *Tx) String() string
- func (tx *Tx) Type() payload.Type
- func (tx *Tx) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAminoCodec ¶ added in v0.19.0
func NewAminoCodec() *aminoCodec
func NewJSONCodec ¶ added in v0.19.0
func NewJSONCodec() *jsonCodec
Types ¶
type Envelope ¶ added in v0.19.0
An envelope contains both the signable Tx and the signatures for each input (in signatories)
func Enclose ¶ added in v0.19.0
Enclose a Payload in an Envelope so it is ready to be signed by first wrapping the Payload as a Tx (including ChainID) and writing it to the Tx field of the Envelope
func (*Envelope) Sign ¶ added in v0.19.0
func (txEnv *Envelope) Sign(signingAccounts ...acm.AddressableSigner) error
Sign the Tx Envelope by adding Signatories containing the signatures for each TxInput. signing accounts for each input must be provided (in any order).
type Signatory ¶ added in v0.19.0
Signatory contains signature and one or both of Address and PublicKey to identify the signer
func (*Signatory) RealisePublicKey ¶ added in v0.19.0
func (s *Signatory) RealisePublicKey(getter state.AccountGetter) error
Attempts to 'realise' the PublicKey and Address of a Signatory possibly referring to state in the case where the Signatory contains an Address by no PublicKey. Checks consistency in other cases, possibly generating the Address from the PublicKey
type Tx ¶
Tx is the canonical object that we serialise to produce the SignBytes that we sign
func (*Tx) GenerateReceipt ¶ added in v0.19.0
Generate a transaction Receipt containing the Tx hash and other information if the Tx is call. Returned by ABCI methods.
func (*Tx) Hash ¶ added in v0.18.0
Generate a Hash for this transaction based on the SignBytes. The hash is memoized over the lifetime of the Tx so repeated calls to Hash() are effectively free
func (*Tx) MarshalJSON ¶ added in v0.19.0
func (*Tx) MustSignBytes ¶ added in v0.19.0
Generate SignBytes, panicking on any failure
func (*Tx) Rehash ¶ added in v0.19.0
Regenerate the Tx hash if it has been mutated or as called by Hash() in first instance
func (*Tx) Sign ¶ added in v0.18.0
func (tx *Tx) Sign(signingAccounts ...acm.AddressableSigner) (*Envelope, error)
Encloses in Envelope and signs envelope
func (*Tx) SignBytes ¶ added in v0.19.0
Produces the canonical SignBytes (the Tx message that will be signed) for a Tx