Skip to content

Commit

Permalink
Remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
CostinCarabas committed Feb 2, 2024
1 parent 2967979 commit 806a769
Showing 1 changed file with 0 additions and 92 deletions.
92 changes: 0 additions & 92 deletions common/transaction/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ multiversx_sc::derive_imports!();

use eth_address::EthAddress;
use multiversx_sc::codec::{EncodeErrorHandler, NestedDecodeInput, TopEncodeOutput};
// use multiversx_sc::codec::{DecodeErrorHandler, EncodeErrorHandler, NestedDecodeInput, TopDecodeInput, TopEncodeOutput};

pub mod transaction_status;

Expand Down Expand Up @@ -102,97 +101,6 @@ impl<M: ManagedTypeApi> TopDecode for EthTransaction<M> {
}
}

// impl<M: ManagedTypeApi> codec::TopEncode for EthTransaction<M> {
// fn top_encode_or_handle_err<O, H>(
// &self,
// output: O,
// h: H,
// ) -> core::result::Result<(), H::HandledErr>
// where
// O: codec::TopEncodeOutput,
// H: codec::EncodeErrorHandler,
// {
// self {

// }
// match self.args. {
// TokenMapperState::NotSet => codec::TopEncode::top_encode_or_handle_err(&"", output, h),
// TokenMapperState::Pending => {
// codec::TopEncode::top_encode_or_handle_err(&"pending", output, h)
// },
// TokenMapperState::Token(token) => {
// codec::TopEncode::top_encode_or_handle_err(&token, output, h)
// },
// }
// }
// }

// impl<M: ManagedTypeApi> TopDecode for EthTransaction<M> {
// fn top_decode_or_handle_err<I, H>(top_input: I, h: H) -> Result<Self, H::HandledErr>
// where
// I: codec::TopDecodeInput,
// H: codec::DecodeErrorHandler,
// {
// let mut nested_buffer = top_input.into_nested_buffer();
// let result = Self::dep_decode_or_handle_err(&mut nested_buffer, h)?;
// if !codec::NestedDecodeInput::is_depleted(&nested_buffer) {
// return Err(h.handle_error(codec::DecodeError::INPUT_TOO_LONG));
// }
// Ok(result)
// }
// }

// impl<M: ManagedTypeApi> codec::TopDecode for EthTransaction<M> {
// fn top_decode_or_handle_err<I, H>(input: I, h: H) -> core::result::Result<Self, H::HandledErr>
// where
// I: codec::TopDecodeInput,
// H: codec::DecodeErrorHandler,
// {
// let decoded_input = ManagedBuffer::top_decode_or_handle_err(input, h)?;
// if decoded_input.is_empty() {
// Ok(TokenMapperState::NotSet)
// } else if decoded_input == PENDING_ENCODING {
// Ok(TokenMapperState::Pending)
// } else {
// let token_id = TokenIdentifier::from_esdt_bytes(decoded_input);
// Ok(TokenMapperState::Token(token_id))
// }
// }
// }

// impl<T: NestedDecode, M: ManagedTypeApi> TopDecode for EthTransaction<M> {
// fn top_decode_or_handle_err<I, H>(input: I, h: H) -> Result<Self, H::HandledErr>
// where
// I: codec::TopDecodeInput,
// H: codec::DecodeErrorHandler,
// {
// let mut result: EthTransaction<T, M> = EthTransaction::new();
// let mut nested_arg = input.into_nested_buffer();
// while !nested_arg.is_depleted() {
// if let Err(capacity_error) =
// result.try_push(T::dep_decode_or_handle_err(&mut nested_arg, h)?)
// {
// return Err(h.handle_error(DecodeError::from(capacity_error)));
// }
// }
// if !nested_arg.is_depleted() {
// if let Err(capacity_error) =
// result.try_push(T::dep_decode_or_handle_err(&mut nested_arg, h)?)
// {
// return Err(h.handle_error(DecodeError::from(capacity_error)));
// }
// }
// Ok(result)
// }

// fn top_decode<I>(input: I) -> Result<Self, DecodeError>
// where
// I: TopDecodeInput,
// {
// Self::top_decode_or_handle_err(input, codec::DefaultErrorHandler)
// }
// }

pub type EthTxAsMultiValue<M> = MultiValue8<
EthAddress<M>,
ManagedAddress<M>,
Expand Down

0 comments on commit 806a769

Please sign in to comment.