[][src]Trait sabre_sdk::TransactionContext

pub trait TransactionContext {
    pub fn get_state_entries(
        &self,
        addresses: &[String]
    ) -> Result<Vec<(String, Vec<u8>)>, WasmSdkError>;
pub fn set_state_entries(
        &self,
        entries: Vec<(String, Vec<u8>)>
    ) -> Result<(), WasmSdkError>;
pub fn delete_state_entries(
        &self,
        addresses: &[String]
    ) -> Result<Vec<String>, WasmSdkError>;
pub fn add_event(
        &self,
        event_type: String,
        attributes: Vec<(String, String)>,
        data: &[u8]
    ) -> Result<(), WasmSdkError>; pub fn get_state(
        &self,
        addresses: &[String]
    ) -> Result<Vec<(String, Vec<u8>)>, WasmSdkError> { ... }
pub fn get_state_entry(
        &self,
        address: &str
    ) -> Result<Option<Vec<u8>>, WasmSdkError> { ... }
pub fn set_state(
        &self,
        entries: HashMap<String, Vec<u8>>
    ) -> Result<(), WasmSdkError> { ... }
pub fn set_state_entry(
        &self,
        address: String,
        data: Vec<u8>
    ) -> Result<(), WasmSdkError> { ... }
pub fn delete_state(
        &self,
        addresses: &[String]
    ) -> Result<Vec<String>, WasmSdkError> { ... }
pub fn delete_state_entry(
        &self,
        address: &str
    ) -> Result<Option<String>, WasmSdkError> { ... } }

Required methods

pub fn get_state_entries(
    &self,
    addresses: &[String]
) -> Result<Vec<(String, Vec<u8>)>, WasmSdkError>
[src]

get_state_entries queries the validator state for data at each of the addresses in the given list. The addresses that have been set are returned.

Arguments

  • addresses - the addresses to fetch

pub fn set_state_entries(
    &self,
    entries: Vec<(String, Vec<u8>)>
) -> Result<(), WasmSdkError>
[src]

set_state_entries requests that each address in the provided map be set in validator state to its corresponding value.

Arguments

  • entries - entries are a hashmap where the key is an address and value is the data

pub fn delete_state_entries(
    &self,
    addresses: &[String]
) -> Result<Vec<String>, WasmSdkError>
[src]

delete_state_entries requests that each of the provided addresses be unset in validator state. A list of successfully deleted addresses is returned.

Arguments

  • addresses - the addresses to delete

pub fn add_event(
    &self,
    event_type: String,
    attributes: Vec<(String, String)>,
    data: &[u8]
) -> Result<(), WasmSdkError>
[src]

add_event adds a new event to the execution result for this transaction.

Arguments

  • event_type - This is used to subscribe to events. It should be globally unique and describe what, in general, has occured.
  • attributes - Additional information about the event that is transparent to the validator. Attributes can be used by subscribers to filter the type of events they receive.
  • data - Additional information about the event that is opaque to the validator.
Loading content...

Provided methods

pub fn get_state(
    &self,
    addresses: &[String]
) -> Result<Vec<(String, Vec<u8>)>, WasmSdkError>
[src]

👎 Deprecated since 0.2.0:

please use get_state_entry or get_state_entries instead

get_state queries the validator state for data at each of the addresses in the given list. The addresses that have been set are returned. get_state is deprecated, please use get_state_entry or get_state_entries instead

Arguments

  • addresses - the addresses to fetch

pub fn get_state_entry(
    &self,
    address: &str
) -> Result<Option<Vec<u8>>, WasmSdkError>
[src]

get_state_entry queries the validator state for data at the address given. If the address is set, the data is returned.

Arguments

  • address - the address to fetch

pub fn set_state(
    &self,
    entries: HashMap<String, Vec<u8>>
) -> Result<(), WasmSdkError>
[src]

👎 Deprecated since 0.2.0:

please use set_state_entry or set_state_entries instead

set_state requests that each address in the provided map be set in validator state to its corresponding value. set_state is deprecated, please use set_state_entry to set_state_entries instead

Arguments

  • entries - entries are a hashmap where the key is an address and value is the data

pub fn set_state_entry(
    &self,
    address: String,
    data: Vec<u8>
) -> Result<(), WasmSdkError>
[src]

set_state_entry requests that the provided address is set in the validator state to its corresponding value.

Arguments

  • address - address of where to store the data
  • data - payload is the data to store at the address

pub fn delete_state(
    &self,
    addresses: &[String]
) -> Result<Vec<String>, WasmSdkError>
[src]

👎 Deprecated since 0.2.0:

please use delete_state_entry or delete_state_entries instead

delete_state requests that each of the provided addresses be unset in validator state. A list of successfully deleted addresses is returned. delete_state is deprecated, please use delete_state_entry to delete_state_entries instead

Arguments

  • addresses - the addresses to delete

pub fn delete_state_entry(
    &self,
    address: &str
) -> Result<Option<String>, WasmSdkError>
[src]

delete_state_entry requests that the provided address be unset in validator state. A list of successfully deleted addresses is returned.

Arguments

  • address - the address to delete
Loading content...

Implementors

impl TransactionContext for SabreTransactionContext[src]

Loading content...