Skip to content
Open
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
3 changes: 2 additions & 1 deletion contracts/invoice_liquidity/src/access.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::errors::ContractError;
use crate::invoice::{get_invoice_funders, invoice_exists, load_invoice, StorageKey};
use crate::invoice::{invoice_exists, load_invoice};
use crate::storage::{get_invoice_funders, DataKey as StorageKey};
use soroban_sdk::{Address, Env};

#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down
75 changes: 34 additions & 41 deletions contracts/invoice_liquidity/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,46 +1,39 @@
use soroban_sdk::contracterror;

#[contracterror]
#[derive(Clone, Debug, PartialEq)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[repr(u32)]
pub enum ContractError {
InvoiceNotFound = 1,
AlreadyFunded = 2,
AlreadyPaid = 3,
NotFunded = 4,
Unauthorized = 5,
InvalidAmount = 6,
InvalidDiscountRate = 7,
InvalidDueDate = 8,
InvoiceDefaulted = 9,
NothingToClaim = 10,
NotYetDefaulted = 11,
OverfundingRejected = 12,
InvoiceExpired = 13,
BatchTooLarge = 14,
AlreadyCancelled = 15,
AlreadyInitialized = 16,
// ── Issue #36: appeal_default ──────────────────────────────────
/// Payer attempted to appeal an invoice that is already in Appealed state.
AlreadyAppealed = 17,
/// Appeal window has closed; appeal can no longer be submitted.
AppealWindowClosed = 18,
/// Action requires the invoice to be in Defaulted state.
NotDefaulted = 19,
// ── Issue #34: LP priority queue ──────────────────────────────
/// LP has already joined the fund queue for this invoice.
AlreadyInQueue = 20,
/// fund_invoice rejected because a different LP was selected by the priority queue.
NotApprovedFunder = 21,
/// Invoice is in Appealed state and cannot be acted upon yet.
InvoiceAppealed = 22,
AlreadyDisputed = 23,
NotDisputed = 24,
InvoiceDisputed = 25,
ContractPaused = 26,
DueDateTooSoon = 27,
DueDateTooFar = 28,
SelfInvoice = 29,
OverpaymentRejected = 30,
/// Issue #28: payer's reputation is below the configured minimum threshold.
PayerReputationTooLow = 31,
Unauthorized = 1,
AlreadyInitialized = 2,
InvalidAmount = 3,
InvalidDiscountRate = 4,
InvalidDueDate = 5,
InvoiceNotFound = 6,
AlreadyPaid = 7,
AlreadyFunded = 8,
NotYetDefaulted = 9,
InvoiceDefaulted = 10,
OverfundingRejected = 11,
OverpaymentRejected = 12,
ArithmeticOverflow = 13,
NothingToClaim = 14,
SelfInvoice = 15,
InvoiceExpired = 16,
BatchTooLarge = 17,
AlreadyCancelled = 18,
ContractPaused = 19,
DueDateTooSoon = 20,
DueDateTooFar = 21,
AlreadyInQueue = 22,
NotApprovedFunder = 23,
PayerReputationTooLow = 24,
InvoiceAppealed = 25,
AlreadyAppealed = 26,
AppealWindowClosed = 27,
NotDefaulted = 28,
AlreadyDisputed = 29,
NotDisputed = 30,
InvoiceDisputed = 31,
NotFunded = 32,
}
Loading
Loading