Skip to content

Commit

Permalink
Merge branch 'master' into background_tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Nov 14, 2024
2 parents b0ec845 + 23fb208 commit e2c945e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions backend/canisters/user_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Fixed

- Fix the ext achievement proposal validation fn ([#6816](https://github.com/open-chat-labs/open-chat/pull/6816))

## [[2.0.1446](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1446-user_index)] - 2024-11-12

### Changed

- Take payment before registering ext achievement ([#6720](https://github.com/open-chat-labs/open-chat/pull/6720))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use candid::CandidType;
use candid::{CandidType, Principal};
use human_readable::{HumanReadablePrincipal, ToHumanReadable};
use serde::{Deserialize, Serialize};
use ts_export::ts_export;
Expand Down Expand Up @@ -27,6 +27,7 @@ pub enum Response {
#[derive(Serialize)]
pub struct HumanReadableArgs {
id: u32,
submitted_by: HumanReadablePrincipal,
name: String,
logo: String,
url: String,
Expand All @@ -42,6 +43,7 @@ impl ToHumanReadable for Args {
fn to_human_readable(&self) -> Self::Target {
HumanReadableArgs {
id: self.id,
submitted_by: Principal::from(self.submitted_by).into(),
name: self.name.clone(),
logo: self.logo.clone(),
url: self.url.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ pub struct ExternalAchievementInternal {
pub remaining_chit_budget: u32,
pub budget_exhausted: Option<TimestampMillis>,
pub awarded: HashSet<UserId>,
#[serde(default)]
pub submitted_by: Option<UserId>,
#[serde(default)]
pub payment_block_index: Option<u64>,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async fn register_external_achievement(args: Args) -> Response {
);

// TODO: Create a timer for when the achievement expires
// 1. Refund any unspent CHAT
// 1. Refund any unspent CHAT and BURN the spent CHAT
// 2. Clear the awarded users HashSet
});

Expand Down

0 comments on commit e2c945e

Please sign in to comment.