Skip to content

Commit

Permalink
Post registry canister upgrade (#4996)
Browse files Browse the repository at this point in the history
  • Loading branch information
megrogan authored Dec 12, 2023
1 parent 2074f22 commit a1c4944
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 2 additions & 0 deletions backend/canisters/registry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

## [[2.0.972](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.972-registry)] - 2023-12-12

### Added

- Added support for message filters in registry ([#4984](https://github.com/open-chat-labs/open-chat/pull/4984))
Expand Down
6 changes: 0 additions & 6 deletions backend/canisters/registry/impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,17 @@ impl RuntimeState {
struct Data {
governance_principals: HashSet<Principal>,
proposals_bot_canister_id: CanisterId,
#[serde(default = "default_user_index_canister_id")]
user_index_canister_id: CanisterId,
sns_wasm_canister_id: CanisterId,
cycles_dispenser_canister_id: CanisterId,
tokens: Tokens,
nervous_systems: NervousSystems,
failed_sns_launches: HashSet<CanisterId>,
#[serde(default)]
message_filters: MessageFilters,
rng_seed: [u8; 32],
test_mode: bool,
}

fn default_user_index_canister_id() -> CanisterId {
Principal::anonymous()
}

impl Data {
pub fn new(
governance_principals: HashSet<Principal>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::lifecycle::{init_env, init_state};
use crate::memory::get_upgrades_memory;
use crate::{mutate_state, Data};
use candid::Principal;
use canister_logger::LogEntry;
use canister_tracing_macros::trace;
use ic_cdk_macros::post_upgrade;
Expand All @@ -16,13 +15,10 @@ fn post_upgrade(args: Args) {
let memory = get_upgrades_memory();
let reader = get_reader(&memory);

let (mut data, logs, traces): (Data, Vec<LogEntry>, Vec<LogEntry>) = serializer::deserialize(reader).unwrap();
let (data, logs, traces): (Data, Vec<LogEntry>, Vec<LogEntry>) = serializer::deserialize(reader).unwrap();

canister_logger::init_with_logs(data.test_mode, logs, traces);

let user_index_canister_id = if data.test_mode { "7njde-waaaa-aaaaf-ab2ca-cai" } else { "4bkt6-4aaaa-aaaaf-aaaiq-cai" };
data.user_index_canister_id = Principal::from_text(user_index_canister_id).unwrap();

let env = init_env(data.rng_seed);
init_cycles_dispenser_client(data.cycles_dispenser_canister_id, data.test_mode);
init_state(env, data, args.wasm_version);
Expand Down
2 changes: 1 addition & 1 deletion canister_commit_ids.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"online_users": "9a6a38f86194b57dc8718c2a595ef4b00cf82d47",
"proposals_bot": "23c4e18dfa32ad868ebf3588bd821d7c0d68d008",
"proposal_validation": "03647d5475bd4cb1b6299c5688e6d4f97928559a",
"registry": "ce3033cea45ce8aa6647c3124d7b99b94caa00c4",
"registry": "2ab7483426e2248c5de9d54ad7fd4765771cd917",
"storage_bucket": "5c4fb8d98e68053c6d93050dfafbd2dbb4c3c9b9",
"storage_index": "8426b83456957cdc997374c8a01d9b641d1d3d08",
"user": "6343c6c2a37fcf3e500dcc2df7b2b678155f2fd2",
Expand Down

0 comments on commit a1c4944

Please sign in to comment.