From 2dd09504c2b675a46c9dd6dd2ef3a3c434d1228f Mon Sep 17 00:00:00 2001 From: Claudiu Ion Lataretu Date: Tue, 15 Mar 2022 15:02:10 +0200 Subject: [PATCH 1/2] metabonding-staking: reduce unbond period to 3 epochs Signed-off-by: Claudiu Ion Lataretu --- dex/farm-staking-contracts/metabonding-staking/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dex/farm-staking-contracts/metabonding-staking/src/lib.rs b/dex/farm-staking-contracts/metabonding-staking/src/lib.rs index e2b21e4c4..af0520f45 100644 --- a/dex/farm-staking-contracts/metabonding-staking/src/lib.rs +++ b/dex/farm-staking-contracts/metabonding-staking/src/lib.rs @@ -8,7 +8,7 @@ pub mod locked_asset_token; use locked_asset_token::UserEntry; pub type SnapshotEntry = MultiValue2, BigUint>; -pub const UNBOND_EPOCHS: u64 = 10; +pub const UNBOND_EPOCHS: u64 = 3; #[elrond_wasm::contract] pub trait MetabondingStaking: From 5aab54021109df44898ec73d18dfa29567800ba7 Mon Sep 17 00:00:00 2001 From: Claudiu Ion Lataretu Date: Tue, 15 Mar 2022 15:07:47 +0200 Subject: [PATCH 2/2] metabonding-staking: fix unit tests Signed-off-by: Claudiu Ion Lataretu --- .../tests/metabonding_staking_test.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dex/farm-staking-contracts/metabonding-staking/tests/metabonding_staking_test.rs b/dex/farm-staking-contracts/metabonding-staking/tests/metabonding_staking_test.rs index 03d62cbbb..dc704397f 100644 --- a/dex/farm-staking-contracts/metabonding-staking/tests/metabonding_staking_test.rs +++ b/dex/farm-staking-contracts/metabonding-staking/tests/metabonding_staking_test.rs @@ -125,7 +125,7 @@ fn test_unstake() { token_nonce: 1, stake_amount: managed_biguint!(0), unstake_amount: managed_biguint!(101_000_000), - unbond_epoch: 10, + unbond_epoch: 3, }; let actual_entry = sc.entry_for_user(&managed_address!(&user_addr)).get(); assert_eq!(actual_entry, expected_entry); @@ -164,7 +164,7 @@ fn test_partial_unstake() { token_nonce: 1, stake_amount: managed_biguint!(40_000_000), unstake_amount: managed_biguint!(51_000_000), - unbond_epoch: 10, + unbond_epoch: 3, }; let actual_entry = sc.entry_for_user(&managed_address!(&user_addr)).get(); assert_eq!(actual_entry, expected_entry); @@ -187,7 +187,7 @@ fn test_partial_unstake() { token_nonce: 1, stake_amount: managed_biguint!(10_000_000), unstake_amount: managed_biguint!(81_000_000), - unbond_epoch: 15, + unbond_epoch: 8, }; let actual_entry = sc.entry_for_user(&managed_address!(&user_addr)).get(); assert_eq!(actual_entry, expected_entry); @@ -204,7 +204,7 @@ fn test_partial_unstake() { token_nonce: 2, stake_amount: managed_biguint!(20_000_000), unstake_amount: managed_biguint!(81_000_000), - unbond_epoch: 15, + unbond_epoch: 8, }; let actual_entry = sc.entry_for_user(&managed_address!(&user_addr)).get(); assert_eq!(actual_entry, expected_entry); @@ -278,7 +278,7 @@ fn test_unbond() { token_nonce: 1, stake_amount: managed_biguint!(0), unstake_amount: managed_biguint!(101_000_000), - unbond_epoch: 10, + unbond_epoch: 3, }; let actual_entry = sc.entry_for_user(&managed_address!(&user_addr)).get(); assert_eq!(actual_entry, expected_entry);