common_primitives/
node.rs1#![cfg_attr(not(feature = "std"), no_std)]
2pub use sp_runtime::{
3 generic,
4 traits::{BlakeTwo256, IdentifyAccount, Verify},
5 DispatchError, MultiAddress, MultiSignature, OpaqueExtrinsic,
6};
7
8extern crate alloc;
9use alloc::{boxed::Box, vec::Vec};
10
11use crate::signatures::UnifiedSignature;
12use frame_support::dispatch::DispatchResultWithPostInfo;
13
14pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;
17
18pub type Address = MultiAddress<AccountId, ()>;
20
21pub type Balance = u128;
23
24pub type Block = generic::Block<Header, OpaqueExtrinsic>;
26
27pub type BlockId = generic::BlockId<Block>;
29
30pub type BlockNumber = u32;
32
33pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
35
36pub type Signature = UnifiedSignature;
38
39pub type Index = u32;
41
42pub type Hash = sp_core::H256;
44pub trait ProposalProvider<AccountId, Proposal> {
46 fn propose(
49 who: AccountId,
50 threshold: u32,
51 proposal: Box<Proposal>,
52 ) -> Result<(u32, u32), DispatchError>;
53
54 fn propose_with_simple_majority(
57 who: AccountId,
58 proposal: Box<Proposal>,
59 ) -> Result<(u32, u32), DispatchError>;
60
61 #[cfg(any(feature = "runtime-benchmarks", feature = "test"))]
63 fn proposal_count() -> u32;
64}
65
66pub trait UtilityProvider<Origin, RuntimeCall> {
68 fn batch_all(origin: Origin, calls: Vec<RuntimeCall>) -> DispatchResultWithPostInfo;
70}
71
72pub trait EIP712Encode {
74 fn encode_eip_712(&self, chain_id: u32) -> Box<[u8]>;
76}