Documentation ¶
Index ¶
- func CalculateGas(queryFunc func(string, common.HexBytes) ([]byte, int64, error), ...) (estimate, adjusted uint64, err error)
- func CompleteAndBroadcastTx(txBldr authtypes.TxBuilder, ctx context.Context, msgs []sdk.Msg) error
- func EnrichWithGas(txBldr authtypes.TxBuilder, ctx context.Context, msgs []sdk.Msg) (authtypes.TxBuilder, error)
- func GenerateOrBroadcastMsgs(ctx context.Context, txBldr authtypes.TxBuilder, msgs []sdk.Msg, offline bool) error
- func GetTxEncoder(cdc *codec.Codec) (encoder sdk.TxEncoder)
- func PrepareTxBuilder(txBldr authtypes.TxBuilder, ctx context.Context) (authtypes.TxBuilder, error)
- func PrintUnsignedStdTx(txBldr authtypes.TxBuilder, ctx context.Context, msgs []sdk.Msg, offline bool) (err error)
- type GasEstimateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateGas ¶
func CalculateGas(queryFunc func(string, common.HexBytes) ([]byte, int64, error), cdc *amino.Codec, txBytes []byte, adjustment float64) (estimate, adjusted uint64, err error)
CalculateGas simulates the execution of a transaction and returns both the estimate obtained by the query and the adjusted amount.
func CompleteAndBroadcastTx ¶
CompleteAndBroadcastTx implements a utility function that facilitates sending a series of messages in a signed transaction given a TxBuilder and a QueryContext. It ensures that the account exists, has a proper number and sequence set. In addition, it builds and signs a transaction with the supplied messages. Finally, it broadcasts the signed transaction to a node.
func EnrichWithGas ¶
func EnrichWithGas(txBldr authtypes.TxBuilder, ctx context.Context, msgs []sdk.Msg) (authtypes.TxBuilder, error)
EnrichWithGas calculates the gas estimate that would be consumed by the transaction and set the transaction's respective value accordingly.
func GenerateOrBroadcastMsgs ¶
func GenerateOrBroadcastMsgs(ctx context.Context, txBldr authtypes.TxBuilder, msgs []sdk.Msg, offline bool) error
GenerateOrBroadcastMsgs respects flags and outputs a message
func GetTxEncoder ¶
GetTxEncoder return tx encoder from global sdk configuration if ones is defined. Otherwise returns encoder with default logic.
func PrepareTxBuilder ¶
PrepareTxBuilder populates a TxBuilder in preparation for the build of a Tx.
Types ¶
type GasEstimateResponse ¶
type GasEstimateResponse struct {
GasEstimate uint64 `json:"gas_estimate"`
}
GasEstimateResponse defines a response definition for tx gas estimation.
func (GasEstimateResponse) String ¶
func (gr GasEstimateResponse) String() string