Skip to content
Open
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
28 changes: 28 additions & 0 deletions tests/wave9_escrow_timelock_guard_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#![no_std]
#[cfg(test)]
mod test {
extern crate std;
use std::println;

#[test]
fn test_wave9_escrow_timelock_duration_bounds() {
let min_timelock_secs: u64 = 3600; // 1 hr
let max_timelock_secs: u64 = 604800; // 7 days
let proposed_lock: u64 = 86400; // 24 hrs

assert!(proposed_lock >= min_timelock_secs, "proposed lock below minimum threshold");
assert!(proposed_lock <= max_timelock_secs, "proposed lock exceeds maximum safety window");
}

#[test]
fn test_wave9_basis_point_royalty_precision() {
let gross_amount: u128 = 250_000_0000; // 2500 tokens
let royalty_bps: u128 = 250; // 2.5%
let calculated_royalty = (gross_amount * royalty_bps) / 10_000;
let net_payout = gross_amount - calculated_royalty;

assert_eq!(calculated_royalty, 6_250_0000);
assert_eq!(net_payout, 243_750_0000);
assert_eq!(net_payout + calculated_royalty, gross_amount);
}
}
Loading