Documentation ¶
Index ¶
- func RequireProof(subpath string) bool
- func RunGRPCQuery(ctx Context, grpcCtx gocontext.Context, method string, req interface{}, ...) (abci.ResponseQuery, metadata.MD, error)
- type Context
- func (ctx *Context) BroadcastSignedData(data []byte) (sdk.TxResponse, error)
- func (ctx *Context) BroadcastSignedDataAsync(data []byte) (sdk.TxResponse, error)
- func (ctx *Context) BroadcastSignedTx(data []byte) (sdk.TxResponse, error)
- func (ctx *Context) Context() context.Context
- func (ctx *Context) GetBalanceByAddress(addr sdk.AccAddress, isProve bool, height string) (sdk.Coins, *merkle.Proof, error)
- func (ctx *Context) GetBlocked() bool
- func (ctx *Context) GetFromAddresses() sdk.AccAddress
- func (ctx *Context) GetNode() (rpclient.Client, error)
- func (ctx *Context) GetNonceByAddress(addr sdk.AccAddress, isProve bool) (uint64, *merkle.Proof, error)
- func (ctx Context) Invoke(grpcCtx gocontext.Context, method string, req, reply interface{}, ...) (err error)
- func (Context) NewStream(gocontext.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error)
- func (ctx Context) PrintOutput(toPrint fmt.Stringer) (err error)
- func (ctx Context) Query(path string, key bytes.HexBytes, isProve bool) ([]byte, int64, *merkle.Proof, error)
- func (ctx Context) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error)
- func (ctx Context) WithBlocked(blocked bool) Context
- func (ctx Context) WithChainID(chainID string) Context
- func (ctx Context) WithClient(client rpclient.Client) Context
- func (ctx Context) WithCode(code int64) Context
- func (ctx Context) WithCodec(cdc *codec.Codec) Context
- func (ctx Context) WithFrom(from sdk.AccAddress) Context
- func (ctx Context) WithHeight(height int64) Context
- func (ctx Context) WithInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequireProof ¶
RequireProof returns whether proof is required for the subpath.
func RunGRPCQuery ¶
func RunGRPCQuery(ctx Context, grpcCtx gocontext.Context, method string, req interface{}, md metadata.MD) (abci.ResponseQuery, metadata.MD, error)
RunGRPCQuery runs a gRPC query from the clientCtx, given all necessary arguments for the gRPC method, and returns the ABCI response. It is used to factorize code between client (Invoke) and server (RegisterGRPCServer) gRPC handlers.
Types ¶
type Context ¶
type Context struct { HomeDir string NodeURI string ChainID string FromAddr sdk.AccAddress Blocked bool Client rpclient.Client Verbose bool Height int64 Cdc *codec.Codec InterfaceRegistry codectypes.InterfaceRegistry Code int64 }
func (*Context) BroadcastSignedData ¶
func (ctx *Context) BroadcastSignedData(data []byte) (sdk.TxResponse, error)
消息确认 同步
func (*Context) BroadcastSignedDataAsync ¶
func (ctx *Context) BroadcastSignedDataAsync(data []byte) (sdk.TxResponse, error)
内部调用 BroadcastTxSync,同步等待checktx 消息,消息确认还是异步的
func (*Context) BroadcastSignedTx ¶
func (ctx *Context) BroadcastSignedTx(data []byte) (sdk.TxResponse, error)
broadcastTx
func (*Context) GetBalanceByAddress ¶
func (*Context) GetBlocked ¶
func (*Context) GetFromAddresses ¶
func (ctx *Context) GetFromAddresses() sdk.AccAddress
func (*Context) GetNonceByAddress ¶
func (Context) Invoke ¶
func (ctx Context) Invoke(grpcCtx gocontext.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error)
Invoke implements the grpc ClientConn.Invoke method
func (Context) NewStream ¶
func (Context) NewStream(gocontext.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error)
NewStream implements the grpc ClientConn.NewStream method
func (Context) PrintOutput ¶
PrintOutput prints output while respecting output and indent flags NOTE: pass in marshalled structs that have been unmarshaled because this function will panic on marshaling errors
func (Context) QueryABCI ¶
func (ctx Context) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error)
QueryABCI performs a query to a Tendermint node with the provide RequestQuery. It returns the ResultQuery obtained from the query.
func (Context) WithBlocked ¶
func (Context) WithChainID ¶
func (Context) WithHeight ¶
func (Context) WithInterfaceRegistry ¶
func (ctx Context) WithInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) Context
WithInterfaceRegistry returns the context with an updated InterfaceRegistry