1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#![forbid(unsafe_code)]
use diem_types::{transaction::TransactionStatus, vm_status::KeptVMStatus};
pub mod account;
pub mod account_universe;
pub mod common_transactions;
pub mod compile;
pub mod currencies;
pub mod data_store;
pub mod execution_strategies;
pub mod executor;
pub mod gas_costs;
mod golden_outputs;
pub mod on_chain_configs;
mod proptest_types;
pub mod utils;
pub mod versioning;
pub fn assert_status_eq(s1: &KeptVMStatus, s2: &KeptVMStatus) -> bool {
assert_eq!(s1, s2);
true
}
pub fn transaction_status_eq(t1: &TransactionStatus, t2: &TransactionStatus) -> bool {
match (t1, t2) {
(TransactionStatus::Discard(s1), TransactionStatus::Discard(s2)) => {
assert_eq!(s1, s2);
true
}
(TransactionStatus::Keep(s1), TransactionStatus::Keep(s2)) => {
assert_eq!(s1, s2);
true
}
_ => false,
}
}
#[macro_export]
macro_rules! assert_prologue_parity {
($e1:expr, $e2:expr, $e3:expr) => {
assert_eq!($e1.unwrap(), $e3);
assert!(transaction_status_eq($e2, &TransactionStatus::Discard($e3)));
};
}
#[macro_export]
macro_rules! assert_prologue_disparity {
($e1:expr => $e2:expr, $e3:expr => $e4:expr) => {
assert_eq!($e1, $e2);
assert!(transaction_status_eq($e3, &$e4));
};
}
#[macro_export]
macro_rules! current_function_name {
() => {{
fn f() {}
fn type_name_of<T>(_: T) -> &'static str {
std::any::type_name::<T>()
}
let name = type_name_of(f);
&name[..name.len() - 3]
}};
}