pub struct SawtoothToTransactHandlerAdapter<H: SawtoothTransactionHandler + Send> { /* fields omitted */ }
Expand description

Adapts a Sawtooth Transaction Handler to a Transact TransactionHandler.

This adapter allows Sawtooth SDK TransactionHandler implementations to be used with the Transact static execution adapters. Existing Sawtooth transaction families and smart contract engines can then be compiled in to an application using Transact.

For example, the Sawtooth transaction handler for the XO Transaction Family can be adapted as follows:

let execution_adapter = StaticExecutionAdapter::new_adapter(
    vec![Box::new(SawtoothToTransactHandlerAdapter::new(
        XoTransactionHandler::new(),
    ))],
    context_manager,
);

Implementations

Constructs a new Sawtooth to Transact handler adapter.

Trait Implementations

TransactionHandler that defines the business logic for a new transaction family. The family_name, family_versions, and namespaces functions are used by the processor to route processing requests to the handler. family_name should return the name of the transaction family that this handler can process, e.g. “intkey” Read more

family_versions should return a list of versions this transaction family handler can process, e.g. [“1.0”] Read more

Apply is the single method where all the business logic for a transaction family is defined. The method will be called by the transaction processor upon receiving a TpProcessRequest that the handler understands and will pass in the TpProcessRequest and an initialized instance of the Context type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Convert self to an expression for Diesel’s query builder. Read more

Convert &self to an expression for Diesel’s query builder. Read more

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more