diff --git a/pallets/slow-clap/Cargo.toml b/pallets/slow-clap/Cargo.toml index 88e0b1b..4814040 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.25" +version = "0.3.26" description = "Applause protocol for the EVM bridge" license.workspace = true authors.workspace = true diff --git a/pallets/slow-clap/src/lib.rs b/pallets/slow-clap/src/lib.rs index 30fb2c8..c68fdd5 100644 --- a/pallets/slow-clap/src/lib.rs +++ b/pallets/slow-clap/src/lib.rs @@ -565,7 +565,13 @@ impl Pallet { ) > Perbill::from_percent(T::ApplauseThreshold::get()); if enough_authorities { - Self::try_applause(&clap, &received_claps_key)?; + if let Err(error_msg) = Self::try_applause(&clap, &received_claps_key) { + log::info!( + target: LOG_TARGET, + "👏 Could not applause because of: {:?}", + error_msg, + ); + } } Ok(()) diff --git a/pallets/slow-clap/src/tests.rs b/pallets/slow-clap/src/tests.rs index 031a485..cad712f 100644 --- a/pallets/slow-clap/src/tests.rs +++ b/pallets/slow-clap/src/tests.rs @@ -524,7 +524,7 @@ fn should_throw_error_if_validator_disabled_and_ignore_later() { } #[test] -fn should_throw_error_on_gatekeeper_amount_overflow() { +fn should_clap_without_applause_on_gatekeeper_amount_overflow() { let big_amount: u64 = u64::MAX; let first_receiver: u64 = 1337; let second_receiver: u64 = 420; @@ -569,12 +569,7 @@ fn should_throw_error_on_gatekeeper_amount_overflow() { }; let authority = UintAuthorityId::from((authority_index + 1) as u64); let signature = authority.sign(&clap.encode()).unwrap(); - if authority_index == 0 { - assert_ok!(SlowClap::slow_clap(RuntimeOrigin::none(), clap, signature)); - } else { - assert_err!(SlowClap::slow_clap(RuntimeOrigin::none(), clap, signature), - Error::::CouldNotIncreaseGatekeeperAmount); - } + assert_ok!(SlowClap::slow_clap(RuntimeOrigin::none(), clap, signature)); } assert_eq!(Balances::balance(&first_receiver), big_amount); @@ -587,7 +582,7 @@ fn should_throw_error_on_gatekeeper_amount_overflow() { } #[test] -fn should_throw_error_on_commission_overflow() { +fn should_clap_without_applause_on_commission_overflow() { let big_amount: u64 = u64::MAX; let first_receiver: u64 = 1337; let second_receiver: u64 = 420; @@ -635,19 +630,14 @@ fn should_throw_error_on_commission_overflow() { }; let authority = UintAuthorityId::from((authority_index + 1) as u64); let signature = authority.sign(&clap.encode()).unwrap(); - if authority_index == 0 { - assert_ok!(SlowClap::slow_clap(RuntimeOrigin::none(), clap, signature)); - } else { - assert_err!(SlowClap::slow_clap(RuntimeOrigin::none(), clap, signature), - Error::::CouldNotAccumulateIncomingImbalance); - } + assert_ok!(SlowClap::slow_clap(RuntimeOrigin::none(), clap, signature)); } assert_eq!(Balances::balance(&first_receiver), big_amount); assert_eq!(Balances::balance(&second_receiver), 0); assert_eq!(Networks::gatekeeper_amount(network_id), big_amount); - assert_eq!(Networks::gatekeeper_amount(network_id_other), 0); + assert_eq!(Networks::gatekeeper_amount(network_id_other), big_amount); assert_eq!(Networks::bridged_imbalance().bridged_in, big_amount); assert_eq!(Networks::bridged_imbalance().bridged_out, 0); });