pub struct Calldata {
pub data: Bytes,
pub wallet_addr: Bytes32,
pub contract_addr: Bytes32,
pub bytes_info: Vec<ByteInfo>,
pub dict: Vec<Bytes32>,
pub lookup: HashMap<Vec<u8>, usize>,
}Expand description
provide a tool to compress a hex string representing a smart contract call. The compression is done by
Fields§
§data: Bytes§wallet_addr: Bytes32§contract_addr: Bytes32§bytes_info: Vec<ByteInfo>§dict: Vec<Bytes32>§lookup: HashMap<Vec<u8>, usize>Implementations§
Source§impl Calldata
impl Calldata
pub fn new( data: Bytes, wallet_addr: Bytes32, contract_addr: Bytes32, ) -> Result<Self, CompressorError>
pub fn analyse(&mut self)
pub fn create_desc( &self, from_byte: usize, array_desc: &[CompressDataDescription], amount_bytes: usize, method: u8, ) -> CompressDataDescription
pub fn add_just_copy_compress( &self, from_byte: usize, result_compress: CompressData, amount: usize, ) -> CompressData
pub fn compress_part(&self, from_byte: usize, to_byte: usize) -> CompressData
pub fn zip( &self, descriptions: &[CompressDataDescription], ) -> Result<Vec<u8>, CompressorError>
pub fn compress(&mut self) -> Result<CompressResult, CompressorError>
pub fn get_byte(&self, n: usize) -> Result<&u8, CompressorError>
pub fn get_bytes( &self, start: usize, n: usize, ) -> Result<&[u8], CompressorError>
pub fn init_dict(&mut self, dict: &[Bytes32])
pub fn check_zeros_case(&self, n: usize) -> CompressDataPower
pub fn check_copy_case_with_zeros(&self, n: usize) -> CompressDataPower
pub fn check_storage_case( &self, n: usize, ) -> Result<Vec<CompressDataPower>, CompressorError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Calldata
impl RefUnwindSafe for Calldata
impl Send for Calldata
impl Sync for Calldata
impl Unpin for Calldata
impl UnwindSafe for Calldata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more