Trait novax_executor::BlockchainProxy
source · pub trait BlockchainProxy: Clone + Send + Sync {
// Required methods
fn new(gateway_url: &str) -> Self;
fn execute_vmquery<'life0, 'life1, 'async_trait>(
&'life0 self,
vm_request: &'life1 VmValueRequest
) -> Pin<Box<dyn Future<Output = Result<VmValuesResponseData, ExecutorError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
The BlockchainProxy trait provides an abstraction over the CommunicationProxy struct from the multiversx-sdk crate.
The main goal of this abstraction is to allow developers to mock the CommunicationProxy struct for testing purposes,
by providing a set of common behaviors required for interacting with the blockchain gateway.
Required Methods§
sourcefn new(gateway_url: &str) -> Self
fn new(gateway_url: &str) -> Self
Creates a new instance of a type implementing BlockchainProxy, initialized with the provided gateway URL.
Parameters
gateway_url: A string slice representing the URL of the blockchain gateway.
Returns
Self: A new instance of the implementing type.
sourcefn execute_vmquery<'life0, 'life1, 'async_trait>(
&'life0 self,
vm_request: &'life1 VmValueRequest
) -> Pin<Box<dyn Future<Output = Result<VmValuesResponseData, ExecutorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_vmquery<'life0, 'life1, 'async_trait>(
&'life0 self,
vm_request: &'life1 VmValueRequest
) -> Pin<Box<dyn Future<Output = Result<VmValuesResponseData, ExecutorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asynchronously executes a virtual machine (VM) query on the blockchain, using the provided VM request.
Parameters
vm_request: A reference to aVmValueRequestobject containing the details of the VM query.
Returns
Result<VmValuesResponseData, ExecutorError>: A result containing the VM query response data, or anExecutorErrorif the query fails.
Object Safety§
Implementations on Foreign Types§
source§impl BlockchainProxy for CommunicationProxy
impl BlockchainProxy for CommunicationProxy
Implementation of the BlockchainProxy trait for the CommunicationProxy struct from the multiversx-sdk crate.
This implementation provides concrete methods to communicate with the blockchain gateway.
source§fn new(gateway_url: &str) -> Self
fn new(gateway_url: &str) -> Self
Creates a new CommunicationProxy instance using the specified blockchain gateway URL.
Parameters
gateway_url: A string slice representing the URL of the blockchain gateway.
Returns
Self: A newCommunicationProxyinstance.
source§fn execute_vmquery<'life0, 'life1, 'async_trait>(
&'life0 self,
vm_request: &'life1 VmValueRequest
) -> Pin<Box<dyn Future<Output = Result<VmValuesResponseData, ExecutorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_vmquery<'life0, 'life1, 'async_trait>(
&'life0 self,
vm_request: &'life1 VmValueRequest
) -> Pin<Box<dyn Future<Output = Result<VmValuesResponseData, ExecutorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asynchronously executes a VM query on the blockchain using the provided VM request, and returns the response data.
Parameters
vm_request: A reference to aVmValueRequestobject containing the details of the VM query.
Returns
Result<VmValuesResponseData, ExecutorError>: A result containing the VM query response data, or anExecutorErrorif the query fails.