diff --git a/backend/canisters/community/CHANGELOG.md b/backend/canisters/community/CHANGELOG.md index 4cf68cedf9..5a406fea0c 100644 --- a/backend/canisters/community/CHANGELOG.md +++ b/backend/canisters/community/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.958](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.958-community)] - 2023-12-05 + ### Added - Add `c2c_send_message` with improved API for c2c calls vs `send_message` ([#4895](https://github.com/open-chat-labs/open-chat/pull/4895)) diff --git a/backend/canisters/community/api/src/updates/c2c_tip_message.rs b/backend/canisters/community/api/src/updates/c2c_tip_message.rs index 0514e68ec0..8df93b42e5 100644 --- a/backend/canisters/community/api/src/updates/c2c_tip_message.rs +++ b/backend/canisters/community/api/src/updates/c2c_tip_message.rs @@ -11,16 +11,11 @@ pub struct Args { pub ledger: CanisterId, pub token: Cryptocurrency, pub amount: u128, - #[serde(default = "eight")] pub decimals: u8, pub username: String, pub display_name: Option, } -fn eight() -> u8 { - 8 -} - #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/group/CHANGELOG.md b/backend/canisters/group/CHANGELOG.md index 6100024fa0..d6d50da21d 100644 --- a/backend/canisters/group/CHANGELOG.md +++ b/backend/canisters/group/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.957](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.957-group)] - 2023-12-05 + ### Added - Add `c2c_send_message` with improved API for c2c calls vs `send_message_v2` ([#4895](https://github.com/open-chat-labs/open-chat/pull/4895)) diff --git a/backend/canisters/group/api/src/updates/c2c_tip_message.rs b/backend/canisters/group/api/src/updates/c2c_tip_message.rs index 484cb1f94a..3a67a3e37d 100644 --- a/backend/canisters/group/api/src/updates/c2c_tip_message.rs +++ b/backend/canisters/group/api/src/updates/c2c_tip_message.rs @@ -10,16 +10,11 @@ pub struct Args { pub ledger: CanisterId, pub token: Cryptocurrency, pub amount: u128, - #[serde(default = "eight")] pub decimals: u8, pub username: String, pub display_name: Option, } -fn eight() -> u8 { - 8 -} - #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/local_user_index/CHANGELOG.md b/backend/canisters/local_user_index/CHANGELOG.md index 787db7d88f..b337acc978 100644 --- a/backend/canisters/local_user_index/CHANGELOG.md +++ b/backend/canisters/local_user_index/CHANGELOG.md @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.959](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.959-local_user_index)] - 2023-12-05 + +### Added + +- Introduce `Lifetime Diamond Membership` ([#4876](https://github.com/open-chat-labs/open-chat/pull/4876)) + ### Changed - Remove `display_name` from `register_user` args ([#4910](https://github.com/open-chat-labs/open-chat/pull/4910)) diff --git a/backend/canisters/proposals_bot/CHANGELOG.md b/backend/canisters/proposals_bot/CHANGELOG.md index d998af440a..2bef189d41 100644 --- a/backend/canisters/proposals_bot/CHANGELOG.md +++ b/backend/canisters/proposals_bot/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.960](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.960-proposals_bot)] - 2023-12-05 + ### Changed - Avoid reseeding random number generator after each upgrade ([#4755](https://github.com/open-chat-labs/open-chat/pull/4755)) diff --git a/backend/canisters/proposals_bot/impl/src/lib.rs b/backend/canisters/proposals_bot/impl/src/lib.rs index 31f2f62a64..afde6aab9b 100644 --- a/backend/canisters/proposals_bot/impl/src/lib.rs +++ b/backend/canisters/proposals_bot/impl/src/lib.rs @@ -79,7 +79,6 @@ struct Data { pub timer_jobs: TimerJobs, pub registry_synced_up_to: TimestampMillis, pub fire_and_forget_handler: FireAndForgetHandler, - #[serde(default)] pub rng_seed: [u8; 32], pub test_mode: bool, } diff --git a/backend/canisters/user/CHANGELOG.md b/backend/canisters/user/CHANGELOG.md index 5192b94055..d154be64d8 100644 --- a/backend/canisters/user/CHANGELOG.md +++ b/backend/canisters/user/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.961](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.961-user)] - 2023-12-05 + ### Added - Support getting batches of chat events via LocalUserIndex ([#4848](https://github.com/open-chat-labs/open-chat/pull/4848)) diff --git a/backend/canisters/user/api/src/updates/c2c_tip_message.rs b/backend/canisters/user/api/src/updates/c2c_tip_message.rs index db4e368375..8c2ba6f9d3 100644 --- a/backend/canisters/user/api/src/updates/c2c_tip_message.rs +++ b/backend/canisters/user/api/src/updates/c2c_tip_message.rs @@ -9,17 +9,12 @@ pub struct Args { pub ledger: CanisterId, pub token: Cryptocurrency, pub amount: u128, - #[serde(default = "eight")] pub decimals: u8, pub username: String, pub display_name: Option, pub user_avatar_id: Option, } -fn eight() -> u8 { - 8 -} - #[derive(CandidType, Serialize, Deserialize, Debug)] pub enum Response { Success, diff --git a/backend/canisters/user_index/CHANGELOG.md b/backend/canisters/user_index/CHANGELOG.md index d649cd5011..4c7cec2bd1 100644 --- a/backend/canisters/user_index/CHANGELOG.md +++ b/backend/canisters/user_index/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [unreleased] +## [[2.0.955](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.955-user_index)] - 2023-12-05 + ### Added - Expose count of new users per day ([#4873](https://github.com/open-chat-labs/open-chat/pull/4873)) diff --git a/backend/canisters/user_index/impl/src/lib.rs b/backend/canisters/user_index/impl/src/lib.rs index fa8e712c0e..25e49c6ac6 100644 --- a/backend/canisters/user_index/impl/src/lib.rs +++ b/backend/canisters/user_index/impl/src/lib.rs @@ -216,22 +216,16 @@ struct Data { pub local_index_map: LocalUserIndexMap, pub timer_jobs: TimerJobs, pub neuron_controllers_for_initial_airdrop: HashMap, - #[serde(default = "nns_governance_canister_id")] pub nns_governance_canister_id: CanisterId, pub internet_identity_canister_id: CanisterId, pub user_referral_leaderboards: UserReferralLeaderboards, pub platform_moderators_group: Option, pub reported_messages: ReportedMessages, pub fire_and_forget_handler: FireAndForgetHandler, - #[serde(default)] pub nns_8_year_neuron: Option, pub rng_seed: [u8; 32], } -fn nns_governance_canister_id() -> CanisterId { - CanisterId::from_text("rrkah-fqaaa-aaaaa-aaaaq-cai").unwrap() -} - impl Data { #[allow(clippy::too_many_arguments)] pub fn new( diff --git a/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs index 6e173aa303..c898b6c3c9 100644 --- a/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs +++ b/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs @@ -1,6 +1,6 @@ use crate::lifecycle::{init_env, init_state}; use crate::memory::get_upgrades_memory; -use crate::{mutate_state, Data, NnsNeuron}; +use crate::Data; use canister_logger::LogEntry; use canister_tracing_macros::trace; use ic_cdk_macros::post_upgrade; @@ -23,17 +23,5 @@ fn post_upgrade(args: Args) { init_cycles_dispenser_client(data.cycles_dispenser_canister_id, data.test_mode); init_state(env, data, args.wasm_version); - mutate_state(|state| { - if !state.data.test_mode { - state.data.nns_8_year_neuron = Some(NnsNeuron { - neuron_id: 17682165960669268263, - subaccount: [ - 106, 24, 201, 114, 207, 210, 101, 85, 190, 208, 248, 112, 144, 208, 19, 164, 28, 86, 155, 119, 164, 16, 3, - 35, 254, 181, 161, 84, 24, 147, 57, 111, - ], - }); - } - }); - info!(version = %args.wasm_version, "Post-upgrade complete"); } diff --git a/backend/canisters/user_index/impl/src/model/diamond_membership_details.rs b/backend/canisters/user_index/impl/src/model/diamond_membership_details.rs index 4f396267ce..66bb11a3b9 100644 --- a/backend/canisters/user_index/impl/src/model/diamond_membership_details.rs +++ b/backend/canisters/user_index/impl/src/model/diamond_membership_details.rs @@ -9,7 +9,6 @@ use utils::time::DAY_IN_MS; const LIFETIME_TIMESTAMP: TimestampMillis = 30000000000000; // This timestamp is in the year 2920 #[derive(Serialize, Deserialize, Clone, Default)] -#[serde(from = "DiamondMembershipDetailsInternalCombined")] pub struct DiamondMembershipDetailsInternal { expires_at: Option, payments: Vec, @@ -18,39 +17,6 @@ pub struct DiamondMembershipDetailsInternal { payment_in_progress: bool, } -#[derive(Serialize, Deserialize, Clone, Default)] -pub struct DiamondMembershipDetailsInternalCombined { - expires_at: Option, - payments: Vec, - #[serde(default)] - pay_in_chat: bool, - #[serde(default)] - subscription: Option, - #[serde(default)] - recurring: bool, - payment_in_progress: bool, -} - -impl From for DiamondMembershipDetailsInternal { - fn from(value: DiamondMembershipDetailsInternalCombined) -> Self { - let subscription = value.subscription.unwrap_or_else(|| { - if value.recurring { - value.payments.last().map(|p| p.duration.into()).unwrap_or_default() - } else { - DiamondMembershipSubscription::Disabled - } - }); - - DiamondMembershipDetailsInternal { - expires_at: value.expires_at, - payments: value.payments, - pay_in_chat: value.pay_in_chat, - subscription, - payment_in_progress: value.payment_in_progress, - } - } -} - #[derive(Serialize, Deserialize, Clone)] pub struct DiamondMembershipPayment { pub timestamp: TimestampMillis, diff --git a/backend/canisters/user_index/impl/src/model/pending_payments_queue.rs b/backend/canisters/user_index/impl/src/model/pending_payments_queue.rs index 18965dc626..a51da6ee03 100644 --- a/backend/canisters/user_index/impl/src/model/pending_payments_queue.rs +++ b/backend/canisters/user_index/impl/src/model/pending_payments_queue.rs @@ -1,4 +1,3 @@ -use candid::Principal; use icrc_ledger_types::icrc1::account::Account; use serde::{Deserialize, Serialize}; use std::collections::VecDeque; @@ -24,7 +23,6 @@ impl PendingPaymentsQueue { } #[derive(Serialize, Deserialize)] -#[serde(from = "PendingPaymentCombined")] pub struct PendingPayment { pub amount: u64, pub currency: Cryptocurrency, @@ -34,35 +32,6 @@ pub struct PendingPayment { pub reason: PendingPaymentReason, } -#[derive(Serialize, Deserialize)] -pub struct PendingPaymentCombined { - pub amount: u64, - pub currency: Cryptocurrency, - pub timestamp: TimestampNanos, - #[serde(default)] - pub recipient_account: Option, - #[serde(default)] - pub recipient: Option, - pub memo: [u8; 32], - pub reason: PendingPaymentReason, -} - -impl From for PendingPayment { - fn from(value: PendingPaymentCombined) -> Self { - PendingPayment { - amount: value.amount, - currency: value.currency, - timestamp: value.timestamp, - recipient_account: value - .recipient_account - .or_else(|| value.recipient.map(Account::from)) - .unwrap(), - memo: value.memo, - reason: value.reason, - } - } -} - #[derive(Serialize, Deserialize, Clone)] pub enum PendingPaymentReason { Treasury, diff --git a/canister_commit_ids.json b/canister_commit_ids.json index fcb7abafab..91e61238ec 100644 --- a/canister_commit_ids.json +++ b/canister_commit_ids.json @@ -1,20 +1,20 @@ { - "community": "303772e423d400a4417b6e3141205d17eb5f7a23", + "community": "81a9224803dd521cbbc46e99f27d673d2298bd65", "cycles_dispenser": "496fd2aa54d194c29a7ba014ee1b6d7d1a2f9a00", - "group": "303772e423d400a4417b6e3141205d17eb5f7a23", + "group": "81a9224803dd521cbbc46e99f27d673d2298bd65", "group_index": "f61321c254e82bb07646160b9ca0fc5dd0a759ea", "local_group_index": "bfb8dc5b93c36c34f21e88b52c36ad5d30b68e09", - "local_user_index": "303772e423d400a4417b6e3141205d17eb5f7a23", + "local_user_index": "f886c1630c5790e6518077d7b1fa8f85906f3fb2", "market_maker": "9a6a38f86194b57dc8718c2a595ef4b00cf82d47", "neuron_controller": "70cd194427a9eb48972ae8924b6e8a6be74199f4", "notifications": "b72fb44d4d34c1b9f34dc6eb650144944b57860a", "notifications_index": "b72fb44d4d34c1b9f34dc6eb650144944b57860a", "online_users": "9a6a38f86194b57dc8718c2a595ef4b00cf82d47", - "proposals_bot": "45d105cb2e7b10198102f940c3a2a12953ef3f82", + "proposals_bot": "23c4e18dfa32ad868ebf3588bd821d7c0d68d008", "proposal_validation": "03647d5475bd4cb1b6299c5688e6d4f97928559a", "registry": "ce3033cea45ce8aa6647c3124d7b99b94caa00c4", "storage_bucket": "5c4fb8d98e68053c6d93050dfafbd2dbb4c3c9b9", "storage_index": "8426b83456957cdc997374c8a01d9b641d1d3d08", - "user": "e38e72c517886c34b81626e791e5669acdc7acbb", - "user_index": "f61321c254e82bb07646160b9ca0fc5dd0a759ea" + "user": "23c4e18dfa32ad868ebf3588bd821d7c0d68d008", + "user_index": "eac89bc6da516a50dd54d94762efb86d468b7781" }