Documentation ¶
Index ¶
- Constants
- Variables
- func DoTx(tx sdk.Tx) (err error)
- func GetSigner() common.Address
- func OutputTx(res *ctypes.ResultBroadcastTxCommit) error
- func OutputTxSync(res *ctypes.ResultBroadcastTx) error
- func PostTx(tx sdk.Tx) (*ctypes.ResultBroadcastTxCommit, error)
- func PostTxSync(tx sdk.Tx) (*ctypes.ResultBroadcastTx, error)
- func PrepareOrPostTx(tx sdk.Tx) (*ctypes.ResultBroadcastTxCommit, error)
- func PrepareOrPostTxSync(tx sdk.Tx) (*ctypes.ResultBroadcastTx, error)
- func PrepareTx(tx sdk.Tx) (bool, error)
- type Validatable
- type Wrapper
- type Wrappers
Constants ¶
const ( FlagName = "name" FlagNoSign = "no-sign" FlagIn = "in" FlagPrepare = "prepare" FlagAddress = "address" FlagType = "type" FlagNonce = "nonce" FlagVMChainId = "vm-chain-id" )
nolint
Variables ¶
var RootCmd = &cobra.Command{
Use: "tx",
Short: "Post tx from json input",
RunE: doRawTx,
}
RootCmd represents the base command when called without any subcommands
Functions ¶
func DoTx ¶
DoTx is a helper function for the lazy :)
It uses only public functions and goes through the standard sequence of wrapping the tx with middleware layers, signing it, either preparing it, or posting it and displaying the result.
If you want a non-standard flow, just call the various functions directly. eg. if you already set the middleware layers in your code, or want to output in another format.
func OutputTx ¶
func OutputTx(res *ctypes.ResultBroadcastTxCommit) error
OutputTx validates if success and prints the tx result to stdout
func OutputTxSync ¶
func OutputTxSync(res *ctypes.ResultBroadcastTx) error
func PostTx ¶
func PostTx(tx sdk.Tx) (*ctypes.ResultBroadcastTxCommit, error)
PostTx does all work once we construct a proper struct it validates the data, signs if needed, transforms to bytes, and posts to the node.
func PostTxSync ¶
func PostTxSync(tx sdk.Tx) (*ctypes.ResultBroadcastTx, error)
PostTx does all work once we construct a proper struct it validates the data, signs if needed, transforms to bytes, and posts to the node.
func PrepareOrPostTx ¶
func PrepareOrPostTx(tx sdk.Tx) (*ctypes.ResultBroadcastTxCommit, error)
PrepareOrPostTx checks the flags to decide to prepare the tx for future multisig, or to post it to the node. Returns error on any failure. If no error and the result is nil, it means it already wrote to file, no post, no need to do more.
func PrepareOrPostTxSync ¶
func PrepareOrPostTxSync(tx sdk.Tx) (*ctypes.ResultBroadcastTx, error)
Types ¶
type Validatable ¶
type Validatable interface {
ValidateBasic() error
}
Validatable represents anything that can be Validated
type Wrapper ¶
Wrapper defines the information needed for each middleware package that wraps the data. They should read all configuration out of bounds via viper.
var ( // Middleware must be set in main.go to defined the wrappers we should apply Middleware Wrapper )