multiversx_chain_vm/tx_mock/
tx_async_promise.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::{AsyncCallTxData, TxFunctionName};

#[derive(Clone, Debug)]
pub struct Promise {
    pub call: AsyncCallTxData,
    pub success_callback: TxFunctionName,
    pub error_callback: TxFunctionName,
    pub callback_closure_data: Vec<u8>,
}

impl Promise {
    pub fn has_callback(&self) -> bool {
        !self.success_callback.is_empty() && !self.error_callback.is_empty()
    }
}