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
#![cfg(any(test, feature = "testutils"))]
#![cfg_attr(feature = "docs", doc(cfg(feature = "testutils")))]
mod sign;
pub use sign::ed25519;
pub use crate::env::testutils::*;
use crate::{AccountId, BytesN, Env, RawVal, Symbol, Vec};
#[doc(hidden)]
pub trait ContractFunctionSet {
fn call(&self, func: &Symbol, env: Env, args: &[RawVal]) -> Option<RawVal>;
}
pub trait Ledger {
fn set(&self, l: LedgerInfo);
fn with_mut<F>(&self, f: F)
where
F: FnMut(&mut LedgerInfo);
}
pub trait Events {
fn all(&self) -> Vec<(crate::BytesN<32>, Vec<RawVal>, RawVal)>;
}
pub trait Logger {
fn all(&self) -> std::vec::Vec<String>;
fn print(&self);
}
pub trait Accounts {
fn generate(&self) -> AccountId;
fn generate_and_create(&self) -> AccountId;
fn create(&self, id: &AccountId);
fn set_thresholds(&self, id: &AccountId, low: u8, med: u8, high: u8);
fn set_signer_weight(&self, id: &AccountId, signer: &BytesN<32>, weight: u8);
fn remove(&self, id: &AccountId);
}