Skip to content

Commit

Permalink
fix evaluator slashing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lederstrumpf authored and JuaniRios committed Nov 27, 2024
1 parent ee318d9 commit 35b2861
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions integration-tests/src/tests/ethereum_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ fn test_hardcoded_signatures() {
// Values generated with `https://github.com/lrazovic/ethsigner`
let polimec_account_ss58 = polimec_runtime::SS58Converter::convert(polimec_account.clone());
dbg!(polimec_account_ss58);
let ethereum_account: [u8; 20] = hex!("FCAd0B19bB29D4674531d6f115237E16AfCE377c");
let signature: [u8; 65] = hex!("4fa35369a2d654112d3fb419e24dc0d7d61b7e3f23936d6d4df0ac8608fa4530795971d4d1967da60853aa974ad57252a521f97bcd5a68ddea5f8959a5c60b471c");
let ethereum_account: [u8; 20] = hex!("796afe7b8933ee8cf337f17887e5c19b657f9ab8");
let signature: [u8; 65] = hex!("952e312ac892fefc7c69051521e78a3bc2727fbb495585bdb5fb77e662b8a3de2b1254058d824e85034710e338c2590e2f92d74ce3c60292ed25c7537d94ed621b");

PolimecNet::execute_with(|| {
assert_ok!(PolimecFunding::verify_receiving_account_signature(
Expand Down
13 changes: 11 additions & 2 deletions integration-tests/src/tests/evaluator_slash_sideffects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use polimec_common::USD_UNIT;
use polimec_runtime::PLMC;
use sp_arithmetic::Perquintill;
use sp_runtime::{FixedU128, MultiAddress::Id};
use xcm::v4::Junction;

generate_accounts!(STASH, ALICE, BOB, CHARLIE, DAVE, ISSUER);

Expand Down Expand Up @@ -77,7 +78,11 @@ fn evaluator_slash_reduces_vesting_schedules() {
vesting_info_4
));

let alice_evaluation = EvaluationParams::<PolimecRuntime>::new(alice.clone(), 35_000 * USD_UNIT);
let alice_evaluation = EvaluationParams::<PolimecRuntime>::new(
alice.clone(),
35_000 * USD_UNIT,
Junction::AccountId32 { network: Some(NetworkId::Polkadot), id: [0u8; 32] },
);
let alice_plmc_evaluated = inst.calculate_evaluation_plmc_spent(vec![alice_evaluation.clone()])[0].plmc_amount;
let alice_slashed = slash_percent * alice_plmc_evaluated;

Expand All @@ -92,7 +97,11 @@ fn evaluator_slash_reduces_vesting_schedules() {
Id(bob.clone()),
vesting_info_5
));
let bob_evaluation = EvaluationParams::<PolimecRuntime>::new(bob.clone(), BOB_EVALUATION * USD_UNIT);
let bob_evaluation = EvaluationParams::<PolimecRuntime>::new(
bob.clone(),
BOB_EVALUATION * USD_UNIT,
Junction::AccountId32 { network: Some(NetworkId::Polkadot), id: [0u8; 32] },
);
let bob_plmc_evaluated = inst.calculate_evaluation_plmc_spent(vec![bob_evaluation.clone()])[0].plmc_amount;
let bob_slashed = slash_percent * bob_plmc_evaluated;

Expand Down

0 comments on commit 35b2861

Please sign in to comment.