Skip to content

Commit

Permalink
remove setAllowExternalClaim
Browse files Browse the repository at this point in the history
  • Loading branch information
psorinionut committed Jul 17, 2024
1 parent 81b6253 commit 4e5e21c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 deletions.
11 changes: 6 additions & 5 deletions common/modules/farm/config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ pub const DEFAULT_FARM_POSITION_MIGRATION_NONCE: u64 = 1;

#[multiversx_sc::module]
pub trait ConfigModule: pausable::PausableModule + permissions_module::PermissionsModule {
#[endpoint(setAllowExternalClaimBoostedRewards)]
fn set_allow_external_claim(&self, allow_external_claim: bool) {
let caller = self.blockchain().get_caller();
self.allow_external_claim(&caller).set(allow_external_claim);
}
// Disabled for this version of the exchange
// #[endpoint(setAllowExternalClaimBoostedRewards)]
// fn set_allow_external_claim(&self, allow_external_claim: bool) {
// let caller = self.blockchain().get_caller();
// self.allow_external_claim(&caller).set(allow_external_claim);
// }

#[inline]
fn is_active(&self) -> bool {
Expand Down
5 changes: 2 additions & 3 deletions dex/farm-with-locked-rewards/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

// Init: 1
// Upgrade: 1
// Endpoints: 67
// Endpoints: 66
// Async Callback: 1
// Total number of exported functions: 70
// Total number of exported functions: 69

#![no_std]

Expand All @@ -32,7 +32,6 @@ multiversx_sc_wasm_adapter::endpoints! {
calculateRewardsForGivenPosition => calculate_rewards_for_given_position
getRewardPerShare => reward_per_share
getRewardReserve => reward_reserve
setAllowExternalClaimBoostedRewards => set_allow_external_claim
getFarmingTokenId => farming_token_id
getRewardTokenId => reward_token_id
getPerBlockRewardAmount => per_block_reward_amount
Expand Down
5 changes: 2 additions & 3 deletions dex/farm/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

// Init: 1
// Upgrade: 1
// Endpoints: 64
// Endpoints: 63
// Async Callback: 1
// Total number of exported functions: 67
// Total number of exported functions: 66

#![no_std]

Expand All @@ -33,7 +33,6 @@ multiversx_sc_wasm_adapter::endpoints! {
calculateRewardsForGivenPosition => calculate_rewards_for_given_position
getRewardPerShare => reward_per_share
getRewardReserve => reward_reserve
setAllowExternalClaimBoostedRewards => set_allow_external_claim
getFarmingTokenId => farming_token_id
getRewardTokenId => reward_token_id
getPerBlockRewardAmount => per_block_reward_amount
Expand Down
13 changes: 7 additions & 6 deletions energy-integration/fees-collector/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ pub trait ConfigModule {
self.all_tokens().set(&all_tokens_vec);
}

#[endpoint(setAllowExternalClaimRewards)]
fn set_allow_external_claim_rewards(&self, allow_external_claim_rewards: bool) {
let caller = self.blockchain().get_caller();
self.allow_external_claim_rewards(&caller)
.set(allow_external_claim_rewards);
}
// Disabled for this version of the exchange
// #[endpoint(setAllowExternalClaimRewards)]
// fn set_allow_external_claim_rewards(&self, allow_external_claim_rewards: bool) {
// let caller = self.blockchain().get_caller();
// self.allow_external_claim_rewards(&caller)
// .set(allow_external_claim_rewards);
// }

#[view(getLockedTokenId)]
#[storage_mapper("lockedTokenId")]
Expand Down
5 changes: 2 additions & 3 deletions energy-integration/fees-collector/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

// Init: 1
// Upgrade: 1
// Endpoints: 38
// Endpoints: 37
// Async Callback (empty): 1
// Total number of exported functions: 41
// Total number of exported functions: 40

#![no_std]

Expand All @@ -26,7 +26,6 @@ multiversx_sc_wasm_adapter::endpoints! {
removeKnownContracts => remove_known_contracts
addKnownTokens => add_known_tokens
removeKnownTokens => remove_known_tokens
setAllowExternalClaimRewards => set_allow_external_claim_rewards
getLockedTokenId => locked_token_id
getAllTokens => get_all_tokens
getAllKnownContracts => known_contracts
Expand Down
6 changes: 4 additions & 2 deletions farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ fn claim_for_others_positive_test() {
&setup.lp_farm_wrapper,
&rust_biguint!(0),
|sc| {
sc.set_allow_external_claim(true);
sc.allow_external_claim(&managed_address!(&user_address))
.set(true);
},
)
.assert_ok();
Expand All @@ -785,7 +786,8 @@ fn claim_for_others_positive_test() {
&setup.staking_farm_wrapper,
&rust_biguint!(0),
|sc| {
sc.set_allow_external_claim(true);
sc.allow_external_claim(&managed_address!(&user_address))
.set(true);
},
)
.assert_ok();
Expand Down
3 changes: 2 additions & 1 deletion farm-staking/farm-staking/tests/farm_staking_setup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,8 @@ where
pub fn allow_external_claim_rewards(&mut self, user: &Address, allow_claim: bool) {
self.b_mock
.execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| {
sc.set_allow_external_claim(allow_claim);
sc.allow_external_claim(&managed_address!(user))
.set(allow_claim);
})
.assert_ok();
}
Expand Down
5 changes: 2 additions & 3 deletions farm-staking/farm-staking/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

// Init: 1
// Upgrade: 1
// Endpoints: 70
// Endpoints: 69
// Async Callback: 1
// Total number of exported functions: 73
// Total number of exported functions: 72

#![no_std]

Expand Down Expand Up @@ -36,7 +36,6 @@ multiversx_sc_wasm_adapter::endpoints! {
getMinUnbondEpochs => min_unbond_epochs
getRewardPerShare => reward_per_share
getRewardReserve => reward_reserve
setAllowExternalClaimBoostedRewards => set_allow_external_claim
getFarmingTokenId => farming_token_id
getRewardTokenId => reward_token_id
getPerBlockRewardAmount => per_block_reward_amount
Expand Down

0 comments on commit 4e5e21c

Please sign in to comment.