Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ All notable changes to this project will be documented in this file.
- Fix `access-pass fund` and `access-pass user-balances` slot counting to track remaining slots per `(payer, client_ip)` pair, preventing a connected user on IP_B from consuming open slots for IP_A; also fix required balance formula to always add `wallet_rent_min` on top of `needs_rent` rather than taking the max
- Add `--user-payer` filter to `user list` command
- Serviceability: onchain activation - atomic close for DeleteDevice ([#3188](https://github.com/malbeclabs/doublezero/pull/3188))
- Fix `access-pass user-balances` and `access-pass fund` underestimating the required wallet balance: the wallet's own rent-exempt minimum was used as a floor rather than being added, causing `missing: 0` to be reported even when provisioning would fail with insufficient funds ([#3213](https://github.com/malbeclabs/doublezero/pull/3213))
- Onchain Programs
- Serviceability: DeleteUser instruction supports atomic deallocate+closeaccount when OnchainAllocation feature is enabled
- Serviceability: CreateLink instruction supports atomic create+allocate+activate when OnchainAllocation feature is enabled
Expand Down
12 changes: 6 additions & 6 deletions smartcontract/cli/src/accesspass/fund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ mod tests {
#[test]
fn test_fund_all_sufficiently_funded() {
let payer = Pubkey::from_str_const("1111111FVAiSujNZVgYSc27t6zUTWoKfAGxbRzzPB");
// balance > required (2_250_000)
let client = setup_client_with_balance(payer, 3_000_000);
// balance > required (wallet_rent_min + needs_rent = 1_000_000 + 1_250_000 = 2_250_000)
let client = setup_client_with_balance(payer, 2_500_000);

let mut out = Vec::new();
let res =
Expand All @@ -260,7 +260,7 @@ mod tests {
#[test]
fn test_fund_dry_run_shows_summary_without_transferring() {
let payer = Pubkey::from_str_const("1111111FVAiSujNZVgYSc27t6zUTWoKfAGxbRzzPB");
// balance = 500_000 < required (2_250_000), deficit = 1_750_000
// balance = 500_000 < required (wallet_rent_min + needs_rent = 1_000_000 + 1_250_000 = 2_250_000), deficit = 1_750_000
let client = setup_client_with_balance(payer, 500_000);

let mut out = Vec::new();
Expand Down Expand Up @@ -316,8 +316,8 @@ mod tests {
#[test]
fn test_fund_min_balance_dominates_rent() {
let payer = Pubkey::from_str_const("1111111FVAiSujNZVgYSc27t6zUTWoKfAGxbRzzPB");
// balance = 1_500_000 < required = wallet_rent_min (1_000_000) + max(needs_rent=1_250_000, min_balance=2_000_000) = 3_000_000
// deficit = 1_500_000
// balance = 1_500_000 > needs_rent (1_250_000) but < required
// required = wallet_rent_min + max(needs_rent, min_balance) = 1_000_000 + max(1_250_000, 2_000_000) = 3_000_000, deficit = 1_500_000
let client = setup_client_with_balance(payer, 1_500_000);

let mut out = Vec::new();
Expand All @@ -338,7 +338,7 @@ mod tests {
fn test_fund_rent_dominates_min_balance() {
let payer = Pubkey::from_str_const("1111111FVAiSujNZVgYSc27t6zUTWoKfAGxbRzzPB");
// balance = 500_000, min_balance = ~1 lamport
// required = wallet_rent_min (1_000_000) + max(needs_rent=1_250_000, 1) = 2_250_000, deficit = 1_750_000
// required = wallet_rent_min + max(needs_rent, min_balance) = 1_000_000 + max(1_250_000, 1) = 2_250_000, deficit = 1_750_000
let client = setup_client_with_balance(payer, 500_000);

let mut out = Vec::new();
Expand Down
Loading