diff --git a/substrate/frame/revive/src/evm/runtime.rs b/substrate/frame/revive/src/evm/runtime.rs index bfff5e79e3ae..d366999b81ca 100644 --- a/substrate/frame/revive/src/evm/runtime.rs +++ b/substrate/frame/revive/src/evm/runtime.rs @@ -313,9 +313,10 @@ pub trait EthExtra { return Err(InvalidTransaction::Call); } - let value = (value / U256::from(::NativeToEthRatio::get())) - .try_into() - .map_err(|_| InvalidTransaction::Call)?; + let value = crate::Pallet::::convert_evm_to_native(value).map_err(|err| { + log::debug!(target: LOG_TARGET, "Failed to convert value to native: {err:?}"); + InvalidTransaction::Call + })?; let call = if let Some(dest) = to { crate::Call::call:: { diff --git a/substrate/frame/revive/src/lib.rs b/substrate/frame/revive/src/lib.rs index d4c2709a32c3..c6a2d36c8662 100644 --- a/substrate/frame/revive/src/lib.rs +++ b/substrate/frame/revive/src/lib.rs @@ -1336,7 +1336,7 @@ where }; let mut tx = TransactionLegacyUnsigned { - value: value.into().saturating_mul(T::NativeToEthRatio::get().into()), + value: Self::convert_native_to_evm(value), input: input.into(), nonce: nonce.into(), chain_id: Some(T::ChainId::get().into()),