force parameters for RewardCurve to be a default balance type, which is u64
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
This commit is contained in:
parent
101e7103f1
commit
f245879925
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1186,7 +1186,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "casper-runtime"
|
name = "casper-runtime"
|
||||||
version = "3.5.30"
|
version = "3.5.31"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"casper-runtime-constants",
|
"casper-runtime-constants",
|
||||||
"frame-benchmarking",
|
"frame-benchmarking",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ghost-slow-clap"
|
name = "ghost-slow-clap"
|
||||||
version = "0.3.39"
|
version = "0.3.40"
|
||||||
description = "Applause protocol for the EVM bridge"
|
description = "Applause protocol for the EVM bridge"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
@ -905,9 +905,9 @@ fn should_nullify_commission_on_finalize() {
|
|||||||
BridgedInflationCurve::<RewardCurve, Runtime>::era_payout(
|
BridgedInflationCurve::<RewardCurve, Runtime>::era_payout(
|
||||||
total_staked,
|
total_staked,
|
||||||
total_issuance,
|
total_issuance,
|
||||||
0
|
0u64
|
||||||
),
|
),
|
||||||
(420000000000000, 0)
|
(420000000000000u64, 0u64)
|
||||||
); // precomputed values
|
); // precomputed values
|
||||||
assert_eq!(Networks::is_nullification_period(), true);
|
assert_eq!(Networks::is_nullification_period(), true);
|
||||||
Networks::on_finalize(System::block_number());
|
Networks::on_finalize(System::block_number());
|
||||||
@ -921,6 +921,7 @@ fn should_nullify_commission_on_finalize() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_avoid_applause_during_nullification_period() {
|
fn should_avoid_applause_during_nullification_period() {
|
||||||
|
let zero: u64 = 0u64;
|
||||||
let total_staked = 69_000_000;
|
let total_staked = 69_000_000;
|
||||||
let total_issuance = 100_000_000;
|
let total_issuance = 100_000_000;
|
||||||
|
|
||||||
@ -936,9 +937,9 @@ fn should_avoid_applause_during_nullification_period() {
|
|||||||
BridgedInflationCurve::<RewardCurve, Runtime>::era_payout(
|
BridgedInflationCurve::<RewardCurve, Runtime>::era_payout(
|
||||||
total_staked,
|
total_staked,
|
||||||
total_issuance,
|
total_issuance,
|
||||||
0
|
zero
|
||||||
),
|
),
|
||||||
(0, 0)
|
(zero, zero)
|
||||||
);
|
);
|
||||||
assert_eq!(Networks::is_nullification_period(), true);
|
assert_eq!(Networks::is_nullification_period(), true);
|
||||||
|
|
||||||
@ -956,6 +957,7 @@ fn should_avoid_applause_during_nullification_period() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_self_applause_if_enough_received_claps() {
|
fn should_self_applause_if_enough_received_claps() {
|
||||||
|
let zero: u64 = 0u64;
|
||||||
let (network_id, transaction_hash, unique_transaction_hash) =
|
let (network_id, transaction_hash, unique_transaction_hash) =
|
||||||
generate_unique_hash(None, None, None, None);
|
generate_unique_hash(None, None, None, None);
|
||||||
let (_, receiver, amount) = get_mocked_metadata();
|
let (_, receiver, amount) = get_mocked_metadata();
|
||||||
@ -981,10 +983,10 @@ fn should_self_applause_if_enough_received_claps() {
|
|||||||
pallet::ApplausesForTransaction::<Runtime>::get(&storage_key),
|
pallet::ApplausesForTransaction::<Runtime>::get(&storage_key),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
assert_eq!(Balances::balance(&receiver), 0);
|
assert_eq!(Balances::balance(&receiver), zero);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
BridgedInflationCurve::<RewardCurve, Runtime>::era_payout(0, 0, 0),
|
BridgedInflationCurve::<RewardCurve, Runtime>::era_payout(zero, zero, zero),
|
||||||
(0, 0)
|
(zero, zero)
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_ok!(do_clap_from(session_index, network_id, 0, false));
|
assert_ok!(do_clap_from(session_index, network_id, 0, false));
|
||||||
|
Loading…
Reference in New Issue
Block a user