Skip to content

Commit

Permalink
Merge pull request #168 from ctindogaru/replace_assertion
Browse files Browse the repository at this point in the history
Replace assertion logic by macro
  • Loading branch information
ctindogaru authored Apr 29, 2022
2 parents f1b0724 + 892308f commit 640495b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sputnikdao2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@ impl Contract {
/// This is NOOP implementation. KEEP IT if you haven't changed contract state.
/// If you have changed state, you need to implement migration from old state (keep the old struct with different name to deserialize it first).
/// After migrate goes live on MainNet, return this implementation for next updates.
#[private]
#[init(ignore_state)]
pub fn migrate() -> Self {
assert_eq!(
env::predecessor_account_id(),
env::current_account_id(),
"ERR_NOT_ALLOWED"
);
let this: Contract = env::state_read().expect("ERR_CONTRACT_IS_NOT_INITIALIZED");
this
}
Expand Down

0 comments on commit 640495b

Please sign in to comment.