Skip to content

Commit

Permalink
Merge pull request #792 from multiversx/ugrade-endpoints
Browse files Browse the repository at this point in the history
separate upgrade endpoint
  • Loading branch information
ovidiuolteanu authored Dec 13, 2023
2 parents bf85891 + d35e367 commit a49c37f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion dex/farm-with-locked-rewards/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ pub trait Farm:
}

#[endpoint]
fn upgrade(&self) {}
fn upgrade(&self) {
// Farm position migration code
let farm_token_mapper = self.farm_token();
self.try_set_farm_position_migration_nonce(farm_token_mapper);
}

#[payable("*")]
#[endpoint(enterFarm)]
Expand Down
6 changes: 5 additions & 1 deletion dex/farm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ pub trait Farm:
}

#[endpoint]
fn upgrade(&self) {}
fn upgrade(&self) {
// Farm position migration code
let farm_token_mapper = self.farm_token();
self.try_set_farm_position_migration_nonce(farm_token_mapper);
}

#[payable("*")]
#[endpoint(enterFarm)]
Expand Down
6 changes: 5 additions & 1 deletion farm-staking/farm-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ pub trait FarmStaking:
}

#[endpoint]
fn upgrade(&self) {}
fn upgrade(&self) {
// Farm position migration code
let farm_token_mapper = self.farm_token();
self.try_set_farm_position_migration_nonce(farm_token_mapper);
}

#[payable("*")]
#[endpoint(mergeFarmTokens)]
Expand Down

0 comments on commit a49c37f

Please sign in to comment.