MockData

Struct MockData 

Source
pub struct MockData {
    tx: Value,
    hosting_ledger_obj: Value,
    header: Value,
    ledger: HashMap<Vec<u8>, Value>,
    nfts: HashMap<Vec<u8>, (Vec<u8>, Value)>,
}

Fields§

§tx: Value§hosting_ledger_obj: Value§header: Value§ledger: HashMap<Vec<u8>, Value>§nfts: HashMap<Vec<u8>, (Vec<u8>, Value)>

Implementations§

Source§

impl MockData

Source

pub fn new( tx_str: &str, hosting_ledger_obj_str: &str, header_str: &str, ledger_str: &str, nfts_str: &str, ) -> Self

Source

pub fn obj_exist(&self, keylet: &Vec<u8>) -> bool

Source

fn get_field_name(&self, field_id: i32) -> Option<String>

Source

pub fn get_field_value( &self, source: DataSource, idx_fields: Vec<i32>, ) -> Result<(i32, &Value), HostError>

Source

pub fn get_ledger_sqn(&self) -> Option<&Value>

Source

pub fn get_parent_ledger_time(&self) -> Option<&Value>

Source

pub fn get_parent_ledger_hash(&self) -> Option<&Value>

Source

pub fn set_current_ledger_obj_data(&mut self, data: Vec<u8>)

Source

pub fn get_nft_uri( &self, nft_id: &Vec<u8>, account_id: &Vec<u8>, ) -> Option<&Value>

Trait Implementations§

Source§

impl Debug for MockData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.