Documentation
¶
Index ¶
- Constants
- type Event
- type RuntimeClient
- type TransactionBuilder
- func (tb *TransactionBuilder) AppendAuthMultisig(config *types.MultisigConfig, nonce uint64) *TransactionBuilder
- func (tb *TransactionBuilder) AppendAuthSignature(pk signature.PublicKey, nonce uint64) *TransactionBuilder
- func (tb *TransactionBuilder) AppendSign(ctx context.Context, signer signature.Signer) error
- func (tb *TransactionBuilder) GetTransaction() *types.Transaction
- func (tb *TransactionBuilder) SetFeeAmount(amount types.BaseUnits) *TransactionBuilder
- func (tb *TransactionBuilder) SetFeeGas(gas uint64) *TransactionBuilder
- func (tb *TransactionBuilder) SubmitTx(ctx context.Context, rsp interface{}) error
- func (tb *TransactionBuilder) SubmitTxNoWait(ctx context.Context) error
Constants ¶
const RoundLatest = coreClient.RoundLatest
RoundLatest is a special round number always referring to the latest round.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
Event is an event emitted by a runtime in the form of a runtime transaction tag.
Key and value semantics are runtime-dependent. TODO: More high-level wrapper for SDK events.
type RuntimeClient ¶
type RuntimeClient interface { // GetInfo returns information about the runtime. GetInfo(ctx context.Context) (*types.RuntimeInfo, error) // SubmitTx submits a transaction to the runtime transaction scheduler and waits // for transaction execution results. SubmitTx(ctx context.Context, tx *types.UnverifiedTransaction) (cbor.RawMessage, error) // SubmitTxNoWait submits a transaction to the runtime transaction scheduler but does // not wait for transaction execution. SubmitTxNoWait(ctx context.Context, tx *types.UnverifiedTransaction) error // GetGenesisBlock returns the genesis block. GetGenesisBlock(ctx context.Context) (*block.Block, error) // GetBlock fetches the given runtime block. GetBlock(ctx context.Context, round uint64) (*block.Block, error) // GetTransactions returns all transactions that are part of a given block. GetTransactions(ctx context.Context, round uint64) ([]*types.UnverifiedTransaction, error) // GetEvents returns all events emitted in a given block. GetEvents(ctx context.Context, round uint64) ([]*coreClient.Event, error) // WatchBlocks subscribes to blocks for a specific runtimes. WatchBlocks(ctx context.Context) (<-chan *roothash.AnnotatedBlock, pubsub.ClosableSubscription, error) // Query makes a runtime-specific query. Query(ctx context.Context, round uint64, method string, args, rsp interface{}) error }
RuntimeClient is a client interface for runtimes based on the Oasis Runtime SDK.
func New ¶
func New(conn *grpc.ClientConn, runtimeID common.Namespace) RuntimeClient
New creates a new runtime client for the specified runtime.
type TransactionBuilder ¶
type TransactionBuilder struct {
// contains filtered or unexported fields
}
TransactionBuilder is a helper for building and submitting transactions.
func NewTransactionBuilder ¶
func NewTransactionBuilder(rc RuntimeClient, method string, body interface{}) *TransactionBuilder
NewTransactionBuilder creates a new transaction builder.
func (*TransactionBuilder) AppendAuthMultisig ¶
func (tb *TransactionBuilder) AppendAuthMultisig(config *types.MultisigConfig, nonce uint64) *TransactionBuilder
AppendAuthMultisig appends a new transaction signer information with a multisig address specification to the transaction.
func (*TransactionBuilder) AppendAuthSignature ¶
func (tb *TransactionBuilder) AppendAuthSignature(pk signature.PublicKey, nonce uint64) *TransactionBuilder
AppendAuthSignature appends a new transaction signer information with a signature address specification to the transaction.
func (*TransactionBuilder) AppendSign ¶
AppendSign signs the transaction and appends the signature.
The signer must be specified in the AuthInfo.
func (*TransactionBuilder) GetTransaction ¶
func (tb *TransactionBuilder) GetTransaction() *types.Transaction
GetTransaction returns the underlying unsigned transaction.
func (*TransactionBuilder) SetFeeAmount ¶
func (tb *TransactionBuilder) SetFeeAmount(amount types.BaseUnits) *TransactionBuilder
SetFeeAmount configures the fee amount to be paid by the caller.
func (*TransactionBuilder) SetFeeGas ¶
func (tb *TransactionBuilder) SetFeeGas(gas uint64) *TransactionBuilder
SetFeeGas configures the maximum gas amount that can be used by the transaction.
func (*TransactionBuilder) SubmitTx ¶
func (tb *TransactionBuilder) SubmitTx(ctx context.Context, rsp interface{}) error
SubmitTx submits a transaction to the runtime transaction scheduler and waits for transaction execution results.
func (*TransactionBuilder) SubmitTxNoWait ¶
func (tb *TransactionBuilder) SubmitTxNoWait(ctx context.Context) error
SubmitTxNoWait submits a transaction to the runtime transaction scheduler but does not wait for transaction execution.