From 30eaa67848d163f894639b0137343454a463b827 Mon Sep 17 00:00:00 2001 From: Martin Hloska Date: Tue, 5 Mar 2024 08:05:58 +0100 Subject: [PATCH] fix evm fee debug assertion --- Cargo.lock | 2 +- runtime/hydradx/Cargo.toml | 2 +- runtime/hydradx/src/evm/evm_fee.rs | 6 +++--- runtime/hydradx/src/lib.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e30df686..5b0dde9c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4621,7 +4621,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "220.0.0" +version = "221.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index cc2f696ab..dc6a4713b 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "220.0.0" +version = "221.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/evm/evm_fee.rs b/runtime/hydradx/src/evm/evm_fee.rs index 208dcf3ae..bb47030c0 100644 --- a/runtime/hydradx/src/evm/evm_fee.rs +++ b/runtime/hydradx/src/evm/evm_fee.rs @@ -153,9 +153,9 @@ where let result = MC::mint_into(paid.asset_id, &account_id, refund_amount); let refund_imbalance = if let Ok(amount) = result { - // just in case of partial refund - // we are not expecting any imbalance, let's try to catch it in debug - debug_assert_eq!(amount, 0); + // Ensure that we minted all amount, in case of partial refund for some reason, + // refund the difference back to treasury + debug_assert_eq!(amount, refund_amount); refund_amount.saturating_sub(amount) } else { // If error, we refund the whole amount back to treasury diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 26db93153..b505b5536 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -108,7 +108,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 220, + spec_version: 221, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1,