pub struct SabreTransactionHandler { /* private fields */ }Expand description
Handles Sabre Transactions
This handler implements the Sawtooth TransactionHandler trait, in order to execute Sabre transaction payloads. These payloads include on-chain smart contracts executed in a WebAssembly virtual machine.
WebAssembly (Wasm) is a stack-based virtual machine newly implemented in major browsers. It is well-suited for the purposes of smart contract execution due to its sandboxed design, growing popularity, and tool support.
Implementations§
Source§impl SabreTransactionHandler
impl SabreTransactionHandler
Sourcepub fn new(
admin_permissions: Box<dyn AdminPermission>,
) -> SabreTransactionHandler
pub fn new( admin_permissions: Box<dyn AdminPermission>, ) -> SabreTransactionHandler
Constructs a new SabreTransactionHandler
Trait Implementations§
Source§impl TransactionHandler for SabreTransactionHandler
impl TransactionHandler for SabreTransactionHandler
Source§fn family_name(&self) -> String
fn family_name(&self) -> String
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”
Source§fn family_versions(&self) -> Vec<String>
fn family_versions(&self) -> Vec<String>
family_versions should return a list of versions this transaction
family handler can process, e.g. [“1.0”]
Source§fn namespaces(&self) -> Vec<String>
fn namespaces(&self) -> Vec<String>
namespaces should return a list containing all the handler’s
namespaces, e.g. [“abcdef”]
Source§fn apply(
&self,
request: &TpProcessRequest,
context: &mut dyn TransactionContext,
) -> Result<(), ApplyError>
fn apply( &self, request: &TpProcessRequest, context: &mut dyn TransactionContext, ) -> Result<(), ApplyError>
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.
Auto Trait Implementations§
impl !RefUnwindSafe for SabreTransactionHandler
impl !Sync for SabreTransactionHandler
impl !UnwindSafe for SabreTransactionHandler
impl Freeze for SabreTransactionHandler
impl Send for SabreTransactionHandler
impl Unpin for SabreTransactionHandler
impl UnsafeUnpin for SabreTransactionHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.