Skip to content

Commit

Permalink
separate upgrade endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidiuolteanu committed Dec 13, 2023
1 parent bf85891 commit b6049bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 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 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 b6049bf

Please sign in to comment.