use thruput_spec::{
ContractEventDef, ContractExceptionType, ContractSpecId,
ContractSpecMethod, ContractSpecString, ContractTypeDef,
};
use xdrs::*;
#[derive(
ReadXDR,
WriteXDR,
ConstXDRSize,
Clone,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
)]
pub struct SpecInterfaceFragment {
pub interface_name: ContractSpecString,
pub interface_version: ContractSpecString,
pub declared_by: ContractSpecId,
pub throws: VecM<ContractExceptionType>,
pub emits: VecM<ContractSpecId>,
}
#[derive(
ReadXDR,
WriteXDR,
ConstXDRSize,
Clone,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
)]
pub struct SpecMethodFragment {
pub interface_name: ContractSpecString,
pub interface_version: ContractSpecString,
pub declared_by: ContractSpecId,
pub method: ContractSpecMethod,
}
#[derive(
ReadXDR,
WriteXDR,
ConstXDRSize,
Clone,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
)]
pub struct SpecInterfaceAnchor {
pub interface_name: ContractSpecString,
pub interface_version: ContractSpecString,
pub declared_by: ContractSpecId,
}
#[derive(
ReadXDR,
WriteXDR,
ConstXDRSize,
Clone,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
)]
#[repr(i32)]
pub enum SpecFragment {
SpecInterface {
interface_fragment: SpecInterfaceFragment,
} = 0,
SpecMethod {
method_fragment: SpecMethodFragment,
} = 1,
SpecTypeDef {
type_def: ContractTypeDef,
} = 2,
ExportedSpecTypeDef {
type_def: ContractTypeDef,
} = 3,
SpecEvent {
event_def: ContractEventDef,
} = 4,
ExportedSpecEvent {
event_def: ContractEventDef,
} = 5,
InterfaceAnchor {
interface_anchor: SpecInterfaceAnchor,
} = 6,
}