Skip to content

Commit 643cf68

Browse files
authored
Merge branch 'main' into driptide/issue-313-1784888228412
2 parents 7b9a33f + 278daa5 commit 643cf68

12 files changed

Lines changed: 4831 additions & 1339 deletions

File tree

contracts/dashboard/src/lib.rs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ impl DashboardContract {
4444
authorized.require_auth();
4545

4646
let key = creator_dashboard_key(&creator);
47-
let mut dashboard: CreatorDashboard = env
48-
.storage()
49-
.persistent()
50-
.get(&key)
51-
.unwrap_or(CreatorDashboard {
52-
invoice_count: 0,
53-
total_volume: 0,
54-
released_count: 0,
55-
refunded_count: 0,
56-
released_volume: 0,
57-
});
47+
let mut dashboard: CreatorDashboard =
48+
env.storage()
49+
.persistent()
50+
.get(&key)
51+
.unwrap_or(CreatorDashboard {
52+
invoice_count: 0,
53+
total_volume: 0,
54+
released_count: 0,
55+
refunded_count: 0,
56+
released_volume: 0,
57+
});
5858
dashboard.invoice_count = dashboard
5959
.invoice_count
6060
.checked_add(1)
@@ -75,17 +75,17 @@ impl DashboardContract {
7575
authorized.require_auth();
7676

7777
let key = creator_dashboard_key(&creator);
78-
let mut dashboard: CreatorDashboard = env
79-
.storage()
80-
.persistent()
81-
.get(&key)
82-
.unwrap_or(CreatorDashboard {
83-
invoice_count: 0,
84-
total_volume: 0,
85-
released_count: 0,
86-
refunded_count: 0,
87-
released_volume: 0,
88-
});
78+
let mut dashboard: CreatorDashboard =
79+
env.storage()
80+
.persistent()
81+
.get(&key)
82+
.unwrap_or(CreatorDashboard {
83+
invoice_count: 0,
84+
total_volume: 0,
85+
released_count: 0,
86+
refunded_count: 0,
87+
released_volume: 0,
88+
});
8989
dashboard.released_count = dashboard
9090
.released_count
9191
.checked_add(1)
@@ -106,17 +106,17 @@ impl DashboardContract {
106106
authorized.require_auth();
107107

108108
let key = creator_dashboard_key(&creator);
109-
let mut dashboard: CreatorDashboard = env
110-
.storage()
111-
.persistent()
112-
.get(&key)
113-
.unwrap_or(CreatorDashboard {
114-
invoice_count: 0,
115-
total_volume: 0,
116-
released_count: 0,
117-
refunded_count: 0,
118-
released_volume: 0,
119-
});
109+
let mut dashboard: CreatorDashboard =
110+
env.storage()
111+
.persistent()
112+
.get(&key)
113+
.unwrap_or(CreatorDashboard {
114+
invoice_count: 0,
115+
total_volume: 0,
116+
released_count: 0,
117+
refunded_count: 0,
118+
released_volume: 0,
119+
});
120120
dashboard.refunded_count = dashboard
121121
.refunded_count
122122
.checked_add(1)

contracts/dashboard/src/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![cfg(test)]
2+
#![allow(clippy::all)]
23

34
use super::*;
45
use soroban_sdk::{testutils::Address as _, Address, Env};

contracts/split/src/error.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@ use soroban_sdk::contracterror;
55
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
66
#[repr(u32)]
77
pub enum ContractError {
8+
NotAuthorized = 1,
9+
InvoiceNotFound = 2,
10+
DeadlinePassed = 3,
11+
AlreadyFunded = 4,
12+
InvalidAmount = 5,
13+
InvoiceFrozen = 6,
14+
InvalidStatus = 7,
15+
PayerNotAllowed = 8,
16+
FundingInsufficient = 9,
17+
NotAuthorized = 1,
18+
InvoiceNotFound = 2,
19+
DeadlinePassed = 3,
20+
AlreadyFunded = 4,
21+
InvalidAmount = 5,
22+
InvoiceFrozen = 6,
23+
InvalidStatus = 7,
24+
PayerNotAllowed = 8,
25+
FundingInsufficient = 9,
26+
OracleCallFailed = 10,
27+
NotArbiter = 11,
28+
NotDisputed = 12,
29+
AlreadyExecuted = 13,
30+
TimelockPending = 14,
31+
ContractPaused = 15,
32+
InvalidRecipients = 16,
33+
PrerequisiteNotMet = 17,
34+
BatchLimitExceeded = 18,
35+
/// Issue #330: Recipient has already been paid on this invoice.
36+
RecipientAlreadyPaid = 19,
37+
/// Issue #327: Funds are still time-locked and cannot be released yet.
38+
FundsLockedUntil = 20,
39+
/// Aggregate protocol statistics would exceed their numeric bounds.
40+
StatsOverflow = 21,
841
NotAuthorized = 1,
942
InvoiceNotFound = 2,
1043
DeadlinePassed = 3,
@@ -29,4 +62,11 @@ pub enum ContractError {
2962
FundsLockedUntil = 20,
3063
/// Aggregate protocol statistics would overflow their storage type.
3164
StatsOverflow = 21,
65+
/// Issue #327: Funds are still time-locked and cannot be released yet.
66+
FundsLockedUntil = 20,
67+
/// Issue #330: Recipient has already been paid on this invoice.
68+
RecipientAlreadyPaid = 19,
69+
/// Oracle-priced invoice: the configured price oracle is unreachable, trapped, or
70+
/// returned a non-positive rate at payment time.
71+
OracleUnavailable = 21,
3272
}

0 commit comments

Comments
 (0)