--- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -64,30 +64,6 @@ T::CrossAccountId::from_sub(account_id) } -/// Convert tuple `(address, uint256)` to `CrossAccountId`. -/// -/// If `address` in the tuple has *default* value, then the canonical form is substrate, -/// if `uint256` has *default* value, then the ethereum form is canonical, -/// if both values are *default* or *non default*, then this is considered an invalid address and `Error` is returned. -pub fn convert_tuple_to_cross_account( - eth_cross_account_id: (address, uint256), -) -> evm_coder::execution::Result -where - T::AccountId: From<[u8; 32]>, -{ - if eth_cross_account_id == Default::default() { - Err("All fields of cross account is zeroed".into()) - } else if eth_cross_account_id.0 == Default::default() { - Ok(convert_uint256_to_cross_account::( - eth_cross_account_id.1, - )) - } else if eth_cross_account_id.1 == Default::default() { - Ok(T::CrossAccountId::from_eth(eth_cross_account_id.0)) - } else { - Err("All fields of cross account is non zeroed".into()) - } -} - /// Cross account struct #[derive(Debug, Default, AbiCoder)] pub struct EthCrossAccount {