From aba2e4ec4b0517a57567ab85aa279e386e5e4a00 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 22 Sep 2023 11:23:05 +0300 Subject: [PATCH] fix farm_position_migration_nonce set function --- common/modules/farm/config/src/config.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index ea4d856e0..e65056062 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -36,7 +36,6 @@ impl Default for UserTotalFarmPosition { #[multiversx_sc::module] pub trait ConfigModule: pausable::PausableModule + permissions_module::PermissionsModule { - #[endpoint(allowExternalClaimBoostedRewards)] fn allow_external_claim_boosted_rewards(&self, allow_external_claim: bool) { let caller = self.blockchain().get_caller(); @@ -69,15 +68,20 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio token_nonce > 0 && token_nonce < farm_position_migration_nonce } - fn try_set_farm_position_migration_nonce(&self, farm_token_mapper: NonFungibleTokenMapper) { + fn try_set_farm_position_migration_nonce( + &self, + farm_token_mapper: NonFungibleTokenMapper, + ) { if !self.farm_position_migration_nonce().is_empty() { return; } let migration_farm_token_nonce = if farm_token_mapper.get_token_state().is_set() { let token_identifier = farm_token_mapper.get_token_id_ref(); - self.blockchain() - .get_current_esdt_nft_nonce(&self.blockchain().get_sc_address(), token_identifier) + let current_nonce = self + .blockchain() + .get_current_esdt_nft_nonce(&self.blockchain().get_sc_address(), token_identifier); + current_nonce + DEFAULT_FARM_POSITION_MIGRATION_NONCE } else { DEFAULT_FARM_POSITION_MIGRATION_NONCE }; @@ -86,7 +90,6 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio .set(migration_farm_token_nonce); } - #[view(getFarmingTokenId)] #[storage_mapper("farming_token_id")] fn farming_token_id(&self) -> SingleValueMapper;