From 1f8f4f0d1295988a4b3e64d5ac9f3f49e5dd239e Mon Sep 17 00:00:00 2001 From: Matt Grogan Date: Tue, 3 Dec 2024 15:33:39 +0200 Subject: [PATCH] Post release (#6956) --- backend/canisters/registry/CHANGELOG.md | 2 + .../impl/src/lifecycle/post_upgrade.rs | 45 +------------------ 2 files changed, 4 insertions(+), 43 deletions(-) diff --git a/backend/canisters/registry/CHANGELOG.md b/backend/canisters/registry/CHANGELOG.md index 278fc6c031..a6a6fe6ad1 100644 --- a/backend/canisters/registry/CHANGELOG.md +++ b/backend/canisters/registry/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.1490](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1490-registry)] - 2024-12-03 + ### Added - Add token ([#6953](https://github.com/open-chat-labs/open-chat/pull/6953)) diff --git a/backend/canisters/registry/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/registry/impl/src/lifecycle/post_upgrade.rs index b82cde651c..2b1c02e4ab 100644 --- a/backend/canisters/registry/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/registry/impl/src/lifecycle/post_upgrade.rs @@ -1,16 +1,12 @@ -use std::time::Duration; - use crate::lifecycle::{init_env, init_state}; use crate::memory::get_upgrades_memory; -use crate::updates::add_token::add_token_impl; -use crate::{read_state, Data}; -use candid::Principal; +use crate::Data; use canister_logger::LogEntry; use canister_tracing_macros::trace; use ic_cdk::post_upgrade; use registry_canister::post_upgrade::Args; use stable_memory::get_reader; -use tracing::{error, info}; +use tracing::info; use utils::cycles::init_cycles_dispenser_client; #[post_upgrade] @@ -29,41 +25,4 @@ fn post_upgrade(args: Args) { init_state(env, data, args.wasm_version); info!(version = %args.wasm_version, "Post-upgrade complete"); - - ic_cdk_timers::set_timer(Duration::ZERO, add_token); -} - -fn add_token() { - ic_cdk::spawn(add_token_inner()); - - async fn add_token_inner() { - if read_state(|state| state.data.test_mode) { - return; - } - - let ledger_canister_id = Principal::from_text("npnnq-naaaa-aaaam-qb7va-cai").unwrap(); - let payer = Principal::from_text("icbn4-5qaaa-aaaaf-bp72q-cai").unwrap().into(); - let info_url = "https://info.icpswap.com/token/details/npnnq-naaaa-aaaam-qb7va-cai".to_string(); - let how_to_buy_url = - "https://app.icpswap.com/swap?input=ryjl3-tyaaa-aaaaa-aaaba-cai&output=npnnq-naaaa-aaaam-qb7va-cai".to_string(); - let transaction_url_format = "https://ic.house/token/npnnq-naaaa-aaaam-qb7va-cai".to_string(); - - let response = add_token_impl( - ledger_canister_id, - Some(payer), - None, - Some(info_url), - Some(how_to_buy_url), - Some(transaction_url_format), - None, - ) - .await; - - match response { - registry_canister::add_token::Response::Success => { - info!("AWB added"); - } - _ => error!("Failed to add AWB: {response:?}"), - } - } }