Skip to content

Commit

Permalink
fix: orbiter upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Nov 25, 2023
1 parent 8531372 commit 58ab005
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 57 deletions.
11 changes: 2 additions & 9 deletions src/orbiter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ mod msg;
mod serializers;
mod store;
mod types;
mod upgrade;

use crate::assert::assert_enabled;
use crate::config::store::{
Expand All @@ -32,7 +31,6 @@ use crate::types::interface::{
};
use crate::types::memory::Memory;
use crate::types::state::{AnalyticKey, HeapState, PageView, SatelliteConfigs, State, TrackEvent};
use crate::upgrade::types::upgrade::UpgradeState;
use ciborium::{from_reader, into_writer};
use ic_cdk::api::call::arg_data;
use ic_cdk::trap;
Expand Down Expand Up @@ -103,15 +101,10 @@ fn post_upgrade() {
memory.read(u64::try_from(OFFSET).unwrap(), &mut state_bytes);

// Deserialize and set the state.
let upgrade_state: UpgradeState = from_reader(&*state_bytes)
let state: State = from_reader(&*state_bytes)
.expect("Failed to decode the state of the satellite in post_upgrade hook.");

STATE.with(|s| {
*s.borrow_mut() = State {
stable: upgrade_state.stable,
heap: HeapState::from(&upgrade_state.heap),
}
});
STATE.with(|s| *s.borrow_mut() = state);
}

/// Data
Expand Down
12 changes: 0 additions & 12 deletions src/orbiter/src/upgrade/impls.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/orbiter/src/upgrade/mod.rs

This file was deleted.

34 changes: 0 additions & 34 deletions src/orbiter/src/upgrade/types.rs

This file was deleted.

0 comments on commit 58ab005

Please sign in to comment.