diff --git a/Cargo.lock b/Cargo.lock index 24fe398..e126dff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3838,7 +3838,7 @@ dependencies = [ [[package]] name = "ghost-slow-clap" -version = "0.4.27" +version = "0.4.28" dependencies = [ "frame-benchmarking", "frame-support", diff --git a/pallets/slow-clap/Cargo.toml b/pallets/slow-clap/Cargo.toml index 5c3f07a..862e9fa 100644 --- a/pallets/slow-clap/Cargo.toml +++ b/pallets/slow-clap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghost-slow-clap" -version = "0.4.27" +version = "0.4.28" 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 e2b9c1b..d3aab81 100644 --- a/pallets/slow-clap/src/lib.rs +++ b/pallets/slow-clap/src/lib.rs @@ -670,6 +670,7 @@ impl Pallet { let mut clap_args_str = clap.receiver.encode(); clap_args_str.extend(&clap.amount.encode()); clap_args_str.extend(&clap.block_number.encode()); + clap_args_str.extend(&clap.transaction_hash.encode()); clap_args_str.extend(&clap.network_id.encode()); H256::from_slice(&sp_io::hashing::keccak_256(&clap_args_str)[..]) diff --git a/pallets/slow-clap/src/tests.rs b/pallets/slow-clap/src/tests.rs index 3246d2d..0500bdb 100644 --- a/pallets/slow-clap/src/tests.rs +++ b/pallets/slow-clap/src/tests.rs @@ -822,7 +822,7 @@ fn should_clap_without_applause_on_gatekeeper_amount_overflow() { let first_receiver: u64 = 1337; let second_receiver: u64 = 420; - let (network_id, block_number, unique_hash) = + let (network_id, block_number, _) = generate_unique_hash(None, None, Some(first_receiver), Some(big_amount), None); new_test_ext().execute_with(|| { @@ -840,13 +840,17 @@ fn should_clap_without_applause_on_gatekeeper_amount_overflow() { receiver: first_receiver, amount: big_amount, }; + let unique_hash = SlowClap::generate_unique_hash(&clap); let authority = UintAuthorityId::from(authority_index as u64); let signature = authority.sign(&clap.encode()).unwrap(); assert_ok!(SlowClap::slow_clap(RuntimeOrigin::none(), clap, signature)); + assert_clapped(&session_index, &unique_hash, authority_index, true); + if authority_index > 2 { + assert_applaused(&session_index, &unique_hash); + } } - assert_applaused(&session_index, &unique_hash); assert_eq!(Balances::total_balance(&first_receiver), big_amount); assert_eq!(Balances::total_balance(&second_receiver), 0);