difftreelog
refactor remove unused fn `convert_tuple_to_cross_account`
in: master
1 file changed
pallets/common/src/eth.rsdiffbeforeafterboth64 T::CrossAccountId::from_sub(account_id)64 T::CrossAccountId::from_sub(account_id)65}65}6667/// Convert tuple `(address, uint256)` to `CrossAccountId`.68///69/// If `address` in the tuple has *default* value, then the canonical form is substrate,70/// if `uint256` has *default* value, then the ethereum form is canonical,71/// if both values are *default* or *non default*, then this is considered an invalid address and `Error` is returned.72pub fn convert_tuple_to_cross_account<T: Config>(73 eth_cross_account_id: (address, uint256),74) -> evm_coder::execution::Result<T::CrossAccountId>75where76 T::AccountId: From<[u8; 32]>,77{78 if eth_cross_account_id == Default::default() {79 Err("All fields of cross account is zeroed".into())80 } else if eth_cross_account_id.0 == Default::default() {81 Ok(convert_uint256_to_cross_account::<T>(82 eth_cross_account_id.1,83 ))84 } else if eth_cross_account_id.1 == Default::default() {85 Ok(T::CrossAccountId::from_eth(eth_cross_account_id.0))86 } else {87 Err("All fields of cross account is non zeroed".into())88 }89}906691/// Cross account struct67/// Cross account struct92#[derive(Debug, Default, AbiCoder)]68#[derive(Debug, Default, AbiCoder)]