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
4 changes: 2 additions & 2 deletions contracts/split/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub fn invoice_released(env: &Env, invoice_id: u64, recipients: &Vec<Address>) {

/// Emitted when an invoice is refunded after deadline.
/// Topics: (split, refunded, invoice_id)
/// Data: (event_seq)
/// Data: (invoice_id, event_seq)
pub fn invoice_refunded(env: &Env, invoice_id: u64) {
let event_seq = next_seq(env, invoice_id);
env.events().publish(
Expand All @@ -118,7 +118,7 @@ pub fn invoice_refunded(env: &Env, invoice_id: u64) {
symbol_short!("refunded"),
invoice_id,
),
(event_seq,),
(invoice_id, event_seq),
);
}

Expand Down
19 changes: 19 additions & 0 deletions contracts/split/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4364,6 +4364,25 @@ impl SplitContract {
env.storage().instance().get(&fee_recipients_key())
}

/// Issue #596: Query whether the contract is currently paused.
/// Returns false if no pause state has been set.
pub fn get_contract_paused(env: Env) -> bool {
env.storage()
.instance()
.get(&storage_keys::StorageKey::Paused)
.unwrap_or(false)
}

/// Issue #597: Query the per-recipient amounts for an invoice without retrieving the full invoice.
/// Throws ContractError::InvoiceNotFound if the invoice does not exist.
pub fn get_invoice_amounts(env: Env, invoice_id: u64) -> Vec<i128> {
env.storage()
.persistent()
.get(&storage_keys::InvoiceKey::AmountsList(invoice_id))
.ok_or(ContractError::InvoiceNotFound)
.unwrap()
}

/// Preview the next invoice id that will be assigned by create_invoice.
pub fn peek_next_invoice_id(env: Env) -> u64 {
env.storage()
Expand Down