Skip to content

Commit acdc940

Browse files
committed
fix: wire missing types, keys, events and fields from merged PRs
- Added PenaltyTier contracttype struct (Vec<(u64,u32)> unsupported by contracttype) - Split admin_frozen from InvoiceExt (at 40-field limit) into InvoiceExt2 - Added penalty_tiers, allowed_callers, refund_grace_secs to InvoiceExt - Added require_kyc, scheduled_release_at to InvoiceOptions - Added donate_on_failure to Payment; wired through pay() → _pay() - Added 8 new event functions (nft_gate_set, timelock, admin freeze, etc.) - Added missing helper fns: pay_shard_key, compute_shard_id, require_admin, etc. - Fixed symbol_short!("fee_waivers") → "fee_wvrs" (max 9 chars) - Fixed ed25519_verify: convert BytesN<32> → Bytes for message arg - Fixed test nonce (per-payer not global) and shard key name ("pay_sh") - All 151 tests pass
1 parent 6b1a5bc commit acdc940

4 files changed

Lines changed: 201 additions & 35 deletions

File tree

contracts/split/src/events.rs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,59 @@ pub fn pending_payout_claimed(env: &Env, invoice_id: u64, recipient: &Address, a
186186
(recipient.clone(), amount),
187187
);
188188
}
189+
190+
pub fn nft_gate_set(env: &Env, contract: &Option<Address>, admin: &Address) {
191+
env.events().publish(
192+
(symbol_short!("split"), symbol_short!("nft_set")),
193+
(contract.clone(), admin.clone()),
194+
);
195+
}
196+
197+
pub fn action_queued(env: &Env, action_id: u64, action: &TimelockAction, admin: &Address) {
198+
env.events().publish(
199+
(symbol_short!("split"), symbol_short!("tl_queue"), action_id),
200+
(action.clone(), admin.clone()),
201+
);
202+
}
203+
204+
pub fn action_executed(env: &Env, action_id: u64, action: &TimelockAction) {
205+
env.events().publish(
206+
(symbol_short!("split"), symbol_short!("tl_exec"), action_id),
207+
action.clone(),
208+
);
209+
}
210+
211+
pub fn action_cancelled(env: &Env, action_id: u64, action: &TimelockAction, admin: &Address) {
212+
env.events().publish(
213+
(symbol_short!("split"), symbol_short!("tl_cncl"), action_id),
214+
(action.clone(), admin.clone()),
215+
);
216+
}
217+
218+
pub fn invoice_admin_frozen(env: &Env, invoice_id: u64, admin: &Address, reason: &String) {
219+
env.events().publish(
220+
(symbol_short!("split"), symbol_short!("adm_frz"), invoice_id),
221+
(admin.clone(), reason.clone()),
222+
);
223+
}
224+
225+
pub fn invoice_admin_unfrozen(env: &Env, invoice_id: u64, admin: &Address) {
226+
env.events().publish(
227+
(symbol_short!("split"), symbol_short!("adm_unf"), invoice_id),
228+
admin.clone(),
229+
);
230+
}
231+
232+
pub fn batch_archived(env: &Env, count: u32, ids: &Vec<u64>) {
233+
env.events().publish(
234+
(symbol_short!("split"), symbol_short!("bat_arc")),
235+
(count, ids.clone()),
236+
);
237+
}
238+
239+
pub fn partial_refund_issued(env: &Env, invoice_id: u64, creator: &Address, bps: u32, amount: i128) {
240+
env.events().publish(
241+
(symbol_short!("split"), symbol_short!("prt_ref"), invoice_id),
242+
(creator.clone(), bps, amount),
243+
);
244+
}

0 commit comments

Comments
 (0)