From f24587992573fdad3d309467cf1c44ad1ad8ee1b Mon Sep 17 00:00:00 2001 From: Uncle Stinky Date: Thu, 14 Aug 2025 16:55:46 +0300 Subject: [PATCH] force parameters for RewardCurve to be a default balance type, which is u64 Signed-off-by: Uncle Stinky --- Cargo.lock | 2 +- pallets/slow-clap/Cargo.toml | 2 +- pallets/slow-clap/src/tests.rs | 16 +++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c923b9b..4cc9873 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1186,7 +1186,7 @@ dependencies = [ [[package]] name = "casper-runtime" -version = "3.5.30" +version = "3.5.31" dependencies = [ "casper-runtime-constants", "frame-benchmarking", diff --git a/pallets/slow-clap/Cargo.toml b/pallets/slow-clap/Cargo.toml index a872e83..d0d47b4 100644 --- a/pallets/slow-clap/Cargo.toml +++ b/pallets/slow-clap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghost-slow-clap" -version = "0.3.39" +version = "0.3.40" description = "Applause protocol for the EVM bridge" license.workspace = true authors.workspace = true diff --git a/pallets/slow-clap/src/tests.rs b/pallets/slow-clap/src/tests.rs index f4c9899..27370b8 100644 --- a/pallets/slow-clap/src/tests.rs +++ b/pallets/slow-clap/src/tests.rs @@ -905,9 +905,9 @@ fn should_nullify_commission_on_finalize() { BridgedInflationCurve::::era_payout( total_staked, total_issuance, - 0 + 0u64 ), - (420000000000000, 0) + (420000000000000u64, 0u64) ); // precomputed values assert_eq!(Networks::is_nullification_period(), true); Networks::on_finalize(System::block_number()); @@ -921,6 +921,7 @@ fn should_nullify_commission_on_finalize() { #[test] fn should_avoid_applause_during_nullification_period() { + let zero: u64 = 0u64; let total_staked = 69_000_000; let total_issuance = 100_000_000; @@ -936,9 +937,9 @@ fn should_avoid_applause_during_nullification_period() { BridgedInflationCurve::::era_payout( total_staked, total_issuance, - 0 + zero ), - (0, 0) + (zero, zero) ); assert_eq!(Networks::is_nullification_period(), true); @@ -956,6 +957,7 @@ fn should_avoid_applause_during_nullification_period() { #[test] fn should_self_applause_if_enough_received_claps() { + let zero: u64 = 0u64; let (network_id, transaction_hash, unique_transaction_hash) = generate_unique_hash(None, None, None, None); let (_, receiver, amount) = get_mocked_metadata(); @@ -981,10 +983,10 @@ fn should_self_applause_if_enough_received_claps() { pallet::ApplausesForTransaction::::get(&storage_key), false ); - assert_eq!(Balances::balance(&receiver), 0); + assert_eq!(Balances::balance(&receiver), zero); assert_eq!( - BridgedInflationCurve::::era_payout(0, 0, 0), - (0, 0) + BridgedInflationCurve::::era_payout(zero, zero, zero), + (zero, zero) ); assert_ok!(do_clap_from(session_index, network_id, 0, false));