#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(unused_imports)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(clippy::unnecessary_cast)]
use crate::*;
use core::option::Option;
use core::ops::{Deref, DerefMut};
#[cfg(feature = "std")]
use std::io::{Read, Write};
#[cfg(feature = "xdrs")]
use xdrs::*;
#[cfg(feature = "serde")]
use ::serde::{{Serialize, Deserialize}};
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[derive(Copy)]
#[repr(transparent)]
pub struct StorageItemType(pub i32);
impl StorageItemType {
pub const kItemTypeBytestring: Self = Self(0);
pub const kItemTypeNonnegativeInt: Self = Self(1);
pub const kItemTypeRetrocausalQueue: Self = Self(2);
pub const kItemTypeReplayCacheData: Self = Self(3);
pub const kItemTypeAuthData: Self = Self(4);
pub const kItemTypeDeployedContractHash: Self = Self(5);
#[doc(hidden)]pub const kItemTypeDeleted: Self = Self(-1);
}
impl From<i32> for StorageItemType {
fn from(v: i32) -> Self {
Self(v)
}
}
#[cfg(feature = "std")]
impl core::fmt::Display for StorageItemType {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self.0 {
x if x == Self::kItemTypeBytestring.0 => {
write!(f, "StorageItemType::kItemTypeBytestring")
},
x if x == Self::kItemTypeNonnegativeInt.0 => {
write!(f, "StorageItemType::kItemTypeNonnegativeInt")
},
x if x == Self::kItemTypeRetrocausalQueue.0 => {
write!(f, "StorageItemType::kItemTypeRetrocausalQueue")
},
x if x == Self::kItemTypeReplayCacheData.0 => {
write!(f, "StorageItemType::kItemTypeReplayCacheData")
},
x if x == Self::kItemTypeAuthData.0 => {
write!(f, "StorageItemType::kItemTypeAuthData")
},
x if x == Self::kItemTypeDeployedContractHash.0 => {
write!(f, "StorageItemType::kItemTypeDeployedContractHash")
},
x if x == Self::kItemTypeDeleted.0 => {
write!(f, "StorageItemType::kItemTypeDeleted")
},
_ => {
write!(f, "StorageItemType({})", self.0)
}
}
}
}
pub const kBytestringCeilingLen : u32 = 65000;
pub const kDefaultMaxBytestringLen : u32 = 1024;
pub type Bytestring = BytesM::<kBytestringCeilingLen>;
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[repr(i32)]
#[non_exhaustive]
pub enum StorageItem {
kItemTypeBytestring { bytestring: Bytestring } = StorageItemType::kItemTypeBytestring.0 as i32,
kItemTypeNonnegativeInt { nnint: int128_xdr } = StorageItemType::kItemTypeNonnegativeInt.0 as i32,
kItemTypeRetrocausalQueue { queue_entries: VecM<QueueEntry> } = StorageItemType::kItemTypeRetrocausalQueue.0 as i32,
kItemTypeReplayCacheData { active_uniquifiers: VecM<Uniquifier> } = StorageItemType::kItemTypeReplayCacheData.0 as i32,
kItemTypeAuthData { auth_data: AddressAuthData } = StorageItemType::kItemTypeAuthData.0 as i32,
kItemTypeDeployedContractHash { deployed_contract_hash: DeployedContractHash } = StorageItemType::kItemTypeDeployedContractHash.0 as i32,
}
#[doc(hidden)]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[repr(i32)]
#[non_exhaustive]
pub enum WireStorageItem {
kItemTypeBytestring { bytestring: Bytestring } = StorageItemType::kItemTypeBytestring.0 as i32,
kItemTypeNonnegativeInt { nnint: int128_xdr } = StorageItemType::kItemTypeNonnegativeInt.0 as i32,
kItemTypeAuthData { auth_data: AddressAuthData } = StorageItemType::kItemTypeAuthData.0 as i32,
kItemTypeRetrocausalQueue { metadata: RetrocausalQueueMetadata } = StorageItemType::kItemTypeRetrocausalQueue.0 as i32,
kItemTypeReplayCacheData = StorageItemType::kItemTypeReplayCacheData.0 as i32,
kItemTypeDeployedContractHash { deployed_contract_hash: DeployedContractHash } = StorageItemType::kItemTypeDeployedContractHash.0 as i32,
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[derive(Copy)]
#[repr(transparent)]
pub struct StorageDeltaType(pub i32);
impl StorageDeltaType {
pub const kDeltaTypeBytestringSet: Self = Self(0);
pub const kDeltaTypeNonnegativeIntSetAdd: Self = Self(1);
pub const kDeltaTypeDelete: Self = Self(2);
pub const kDeltaTypeRetrocausalQueue: Self = Self(3);
pub const kDeltaTypeNonnegativeIntAdd: Self = Self(5);
pub const kDeltaTypeAuthDataChange: Self = Self(6);
pub const kDeltaTypeDeployContract: Self = Self(7);
pub const kDeltaTypeConsumeUniquifier: Self = Self(8);
}
impl From<i32> for StorageDeltaType {
fn from(v: i32) -> Self {
Self(v)
}
}
#[cfg(feature = "std")]
impl core::fmt::Display for StorageDeltaType {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self.0 {
x if x == Self::kDeltaTypeBytestringSet.0 => {
write!(f, "StorageDeltaType::kDeltaTypeBytestringSet")
},
x if x == Self::kDeltaTypeNonnegativeIntSetAdd.0 => {
write!(f, "StorageDeltaType::kDeltaTypeNonnegativeIntSetAdd")
},
x if x == Self::kDeltaTypeDelete.0 => {
write!(f, "StorageDeltaType::kDeltaTypeDelete")
},
x if x == Self::kDeltaTypeRetrocausalQueue.0 => {
write!(f, "StorageDeltaType::kDeltaTypeRetrocausalQueue")
},
x if x == Self::kDeltaTypeNonnegativeIntAdd.0 => {
write!(f, "StorageDeltaType::kDeltaTypeNonnegativeIntAdd")
},
x if x == Self::kDeltaTypeAuthDataChange.0 => {
write!(f, "StorageDeltaType::kDeltaTypeAuthDataChange")
},
x if x == Self::kDeltaTypeDeployContract.0 => {
write!(f, "StorageDeltaType::kDeltaTypeDeployContract")
},
x if x == Self::kDeltaTypeConsumeUniquifier.0 => {
write!(f, "StorageDeltaType::kDeltaTypeConsumeUniquifier")
},
_ => {
write!(f, "StorageDeltaType({})", self.0)
}
}
}
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct AuthDataChangeSigner {
pub public_key_id: u32,
pub public_key: PublicKeyConfigOpt,
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct AuthDataChangeArgs {
pub auth_data_change_signers: VecM<AuthDataChangeSigner, kMaxSigners>,
pub new_required_weight: Option<Weight>,
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct NonnegativeInt128SetAddArgs {
pub set_value: int128_xdr,
pub add_value: int128_xdr,
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct ConsumeUniquifierArgs {
pub uniquifier: Uniquifier,
}
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[repr(i32)]
#[non_exhaustive]
pub enum StorageDelta {
kDeltaTypeBytestringSet { bytestring: Bytestring } = StorageDeltaType::kDeltaTypeBytestringSet.0 as i32,
kDeltaTypeNonnegativeIntSetAdd { nnint: NonnegativeInt128SetAddArgs } = StorageDeltaType::kDeltaTypeNonnegativeIntSetAdd.0 as i32,
kDeltaTypeNonnegativeIntAdd { nnint_add: int128_xdr } = StorageDeltaType::kDeltaTypeNonnegativeIntAdd.0 as i32,
kDeltaTypeDelete = StorageDeltaType::kDeltaTypeDelete.0 as i32,
kDeltaTypeRetrocausalQueue { retrocausal_queue: RetrocausalQueueDelta } = StorageDeltaType::kDeltaTypeRetrocausalQueue.0 as i32,
kDeltaTypeAuthDataChange { auth_data_change: AuthDataChangeArgs } = StorageDeltaType::kDeltaTypeAuthDataChange.0 as i32,
kDeltaTypeDeployContract { deployed_contract_hash: DeployedContractHash } = StorageDeltaType::kDeltaTypeDeployContract.0 as i32,
kDeltaTypeConsumeUniquifier { consume_uniquifier_args: ConsumeUniquifierArgs } = StorageDeltaType::kDeltaTypeConsumeUniquifier.0 as i32,
}
pub const kReplayCacheHeightsMaxLen : u32 = 4000;
pub const kReplayCacheNoncesMaxLen : u32 = 8000;
#[doc(hidden)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct ReplayCacheHeightCount {
pub height: BlockHeight,
pub nonce_count: u32,
}
#[doc(hidden)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct ReplayCacheMetadata {
pub size: i64,
pub heights: VecM<ReplayCacheHeightCount, kReplayCacheNoncesMaxLen>,
}
#[doc(hidden)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct ReplayCacheData {
pub nonces: VecM<u64, kReplayCacheNoncesMaxLen>,
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[derive(Copy)]
#[repr(transparent)]
pub struct StorageDeltaFlags(pub i32);
impl StorageDeltaFlags {
pub const None: Self = Self(0);
pub const ExclusiveLock: Self = Self(0x00000001);
}
impl From<i32> for StorageDeltaFlags {
fn from(v: i32) -> Self {
Self(v)
}
}
#[cfg(feature = "std")]
impl core::fmt::Display for StorageDeltaFlags {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self.0 {
x if x == Self::None.0 => {
write!(f, "StorageDeltaFlags::None")
},
x if x == Self::ExclusiveLock.0 => {
write!(f, "StorageDeltaFlags::ExclusiveLock")
},
_ => {
write!(f, "StorageDeltaFlags({})", self.0)
}
}
}
}
pub type StorageDeltaFlagSet = u32;
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(C)]
pub struct FlaggedStorageDelta {
pub addrkey: AddressAndKey,
pub delta: StorageDelta,
pub flags: StorageDeltaFlagSet,
}
impl StorageItem {
#[allow(clippy::match_single_binding)]
pub fn r#type(&self) -> StorageItemType {
match self {
_ => (unsafe { *(self as *const Self as *const i32) }).into(),
}
}
}
impl WireStorageItem {
#[allow(clippy::match_single_binding)]
pub fn r#type(&self) -> StorageItemType {
match self {
_ => (unsafe { *(self as *const Self as *const i32) }).into(),
}
}
}
impl StorageDelta {
#[allow(clippy::match_single_binding)]
pub fn r#type(&self) -> StorageDeltaType {
match self {
_ => (unsafe { *(self as *const Self as *const i32) }).into(),
}
}
}