#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;
use alloc::{borrow::ToOwned, vec::Vec};
use codec::{Decode, Encode};
pub use alloc::{collections::BTreeMap, vec};
pub use events::{EventDetails, Events, RawEventDetails};
pub use metadata::{Metadata, MetadataError};
pub use scale_decode::DecodeAsType;
pub mod error;
pub mod events;
pub mod metadata;
pub mod storage;
#[cfg(any(feature = "mocks", test))]
pub mod test_utils;
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub struct Encoded(pub Vec<u8>);
impl codec::Encode for Encoded {
fn encode(&self) -> Vec<u8> {
self.0.to_owned()
}
}
pub trait StaticEvent: Decode {
const PALLET: &'static str;
const EVENT: &'static str;
fn is_event(pallet: &str, event: &str) -> bool {
Self::PALLET == pallet && Self::EVENT == event
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Encode, Decode)]
pub enum Phase {
ApplyExtrinsic(u32),
Finalization,
Initialization,
}
#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug)]
pub struct EventRecord<E, T> {
pub phase: Phase,
pub event: E,
pub topics: Vec<T>,
}