multiversx_chain_vm/tx_mock/
tx_result_calls.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use super::{AsyncCallTxData, Promise};

#[derive(Clone, Default, Debug)]
pub struct TxResultCalls {
    pub async_call: Option<AsyncCallTxData>,
    pub promises: Vec<Promise>,
}

impl TxResultCalls {
    pub fn empty() -> Self {
        TxResultCalls {
            async_call: None,
            promises: Vec::new(),
        }
    }

    pub fn no_calls(&self) -> bool {
        self.async_call.is_none() && self.promises.is_empty()
    }
}