diff --git a/contracts/split/src/events.rs b/contracts/split/src/events.rs index aa64ec6..c292445 100644 --- a/contracts/split/src/events.rs +++ b/contracts/split/src/events.rs @@ -109,7 +109,7 @@ pub fn invoice_released(env: &Env, invoice_id: u64, recipients: &Vec
) { /// 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( @@ -118,7 +118,7 @@ pub fn invoice_refunded(env: &Env, invoice_id: u64) { symbol_short!("refunded"), invoice_id, ), - (event_seq,), + (invoice_id, event_seq), ); } diff --git a/contracts/split/src/lib.rs b/contracts/split/src/lib.rs index 6671cc8..82c2a02 100644 --- a/contracts/split/src/lib.rs +++ b/contracts/split/src/lib.rs @@ -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 { + 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()