Skip to content

Commit

Permalink
Merge branch 'master' into monthly_chit
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Jul 23, 2024
2 parents de2a4f4 + d34623f commit 305a429
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ ic-ledger-types = "0.11.0"
ic-stable-structures = "0.6.4"
ic-transport-types = "0.35.0"
ic-utils = "0.35.0"
ic-verifiable-credentials = { git = "https://github.com/dfinity/verifiable-credentials-sdk", rev = "2cc9be24599b755f9584f270dbe429f09ccf473f" }
ic-verifiable-credentials = { git = "https://github.com/dfinity/verifiable-credentials-sdk", rev = "a116a2e53a13e4a1f6f7e8429960a7d0d6142e70" }
icrc-ledger-types = "0.1.5"
ic0 = "0.23.0"
itertools = "0.13.0"
Expand Down
4 changes: 4 additions & 0 deletions backend/canisters/community/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Added

- Add `Locked` gate ([#6095](https://github.com/open-chat-labs/open-chat/pull/6095))

### Changed

- Fix fee then retry transfer if fee too high ([#6063](https://github.com/open-chat-labs/open-chat/pull/6063))
Expand Down
4 changes: 4 additions & 0 deletions backend/canisters/group/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Added

- Add `Locked` gate ([#6095](https://github.com/open-chat-labs/open-chat/pull/6095))

### Changed

- Fix fee then retry transfer if fee too high ([#6063](https://github.com/open-chat-labs/open-chat/pull/6063))
Expand Down
4 changes: 4 additions & 0 deletions backend/canisters/group_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Added

- Add `Locked` gate ([#6095](https://github.com/open-chat-labs/open-chat/pull/6095))

### Changed

- Clear old data from the failed upgrades log ([#6062](https://github.com/open-chat-labs/open-chat/pull/6062))
Expand Down
3 changes: 3 additions & 0 deletions backend/canisters/group_index/impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ pub struct AccessGateMetrics {
pub token_balance: u32,
#[serde(default)]
pub composite: u32,
#[serde(default)]
pub locked: u32,
}

impl AccessGateMetrics {
Expand All @@ -393,6 +395,7 @@ impl AccessGateMetrics {
AccessGate::Payment(_) => self.payment += 1,
AccessGate::TokenBalance(_) => self.token_balance += 1,
AccessGate::Composite(_) => self.composite += 1,
AccessGate::Locked => self.locked += 1,
}
}
}
4 changes: 4 additions & 0 deletions backend/canisters/local_group_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Added

- Add `Locked` gate ([#6095](https://github.com/open-chat-labs/open-chat/pull/6095))

### Changed

- Clear old data from the failed upgrades log ([#6062](https://github.com/open-chat-labs/open-chat/pull/6062))
Expand Down
1 change: 1 addition & 0 deletions backend/canisters/local_user_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Support submitting proof of uniqueness to LocalUserIndex ([#6068](https://github.com/open-chat-labs/open-chat/pull/6068))
- Support submitting proof of diamond membership to LocalUserIndex ([#6084](https://github.com/open-chat-labs/open-chat/pull/6084))
- Add `Locked` gate ([#6095](https://github.com/open-chat-labs/open-chat/pull/6095))

### Changed

Expand Down
4 changes: 4 additions & 0 deletions backend/canisters/user/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Added

- Add `Locked` gate ([#6095](https://github.com/open-chat-labs/open-chat/pull/6095))

### Changed

- Improve check for empty and dormant users ([#6073](https://github.com/open-chat-labs/open-chat/pull/6073))
Expand Down
1 change: 1 addition & 0 deletions backend/canisters/user_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Ensure UserIndex is only controller before installing LocalUserIndex ([#6070](https://github.com/open-chat-labs/open-chat/pull/6070))
- Store CHIT balances per month ([#6087](https://github.com/open-chat-labs/open-chat/pull/6087))
- Add `user_ii_principal` to `submit_proof_of_unique_personhood` args ([#6092](https://github.com/open-chat-labs/open-chat/pull/6092))
- Bump `ic-verifiable-credentials` to latest version ([#6096](https://github.com/open-chat-labs/open-chat/pull/6096))

### Removed

Expand Down
1 change: 1 addition & 0 deletions backend/libraries/gated_groups/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ async fn check_non_composite_gate(gate: AccessGate, args: CheckGateArgs) -> Chec
AccessGate::Payment(g) => try_transfer_from(&g, args.user_id, args.this_canister, args.now).await,
AccessGate::TokenBalance(g) => check_token_balance_gate(&g, args.user_id).await,
AccessGate::Composite(_) => unreachable!(),
AccessGate::Locked => CheckIfPassesGateResult::Failed(GateCheckFailedReason::Locked),
}
}

Expand Down
2 changes: 2 additions & 0 deletions backend/libraries/types/can.did
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,7 @@ type AccessGate = variant {
inner : vec AccessGate;
and : bool;
};
Locked;
};

type AccessGateUpdate = variant {
Expand Down Expand Up @@ -1577,6 +1578,7 @@ type GateCheckFailedReason = variant {
PaymentFailed : ICRC2_TransferFromError;
InsufficientBalance : nat;
FailedVerifiedCredentialCheck : text;
Locked;
};

type VerifiedCredentialGateArgs = record {
Expand Down
3 changes: 3 additions & 0 deletions backend/libraries/types/src/gated_groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub enum AccessGate {
Payment(PaymentGate),
TokenBalance(TokenBalanceGate),
Composite(CompositeGate),
Locked,
}

impl AccessGate {
Expand Down Expand Up @@ -45,6 +46,7 @@ impl AccessGate {
AccessGate::Payment(_) => "payment",
AccessGate::TokenBalance(_) => "token_balance",
AccessGate::Composite(_) => "composite",
AccessGate::Locked => "locked",
}
}
}
Expand Down Expand Up @@ -101,6 +103,7 @@ pub enum GateCheckFailedReason {
PaymentFailed(TransferFromError),
InsufficientBalance(u128),
FailedVerifiedCredentialCheck(String),
Locked,
}

#[derive(CandidType, Serialize, Deserialize, Clone, Debug)]
Expand Down

0 comments on commit 305a429

Please sign in to comment.