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
730 changes: 392 additions & 338 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ sanctifier-test-support = { path = "contracts/test-support" }

[workspace.package]
rust-version = "1.78"
license = "MIT OR Apache-2.0"

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] }
Expand Down
1 change: 1 addition & 0 deletions contracts/allowance-race/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
license.workspace = true
name = "allowance-race"
version = "0.1.0"
edition = "2021"
Expand Down
1 change: 1 addition & 0 deletions contracts/amm-pool/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
license.workspace = true
name = "amm-pool"
version = "0.1.0"
edition = "2021"
Expand Down
1 change: 1 addition & 0 deletions contracts/benchmark/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
license.workspace = true
name = "benchmark"
version = "0.1.0"
edition = "2021"
Expand Down
28 changes: 14 additions & 14 deletions contracts/benchmark/src/vesting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,29 @@ mod tests {
#[test]
fn vested_amount_before_cliff_within_budget() {
let env = Env::default();
let (_client, _, _) = setup(&env);
env.ledger().set_timestamp(150); // before start time
// Since vested_amount doesn't exist, just test that the contract is callable
// The actual implementation would be in the contract logic
let (client, _, _) = setup(&env);
env.ledger().set_timestamp(150); // before cliff (start + cliff = 100 + 200 = 300)
let amount = client.vested_amount();
assert_eq!(amount, 0);
}

#[test]
fn vested_amount_midway_within_budget() {
let env = Env::default();
let (_client, _, _) = setup(&env);
let (client, _, _) = setup(&env);
// at timestamp 600: 500 elapsed out of 1000 duration → 50% of 10_000 = 5_000
env.ledger().set_timestamp(600);
// Since vested_amount doesn't exist, just test that the contract is callable
// The actual implementation would be in the contract logic
let amount = client.vested_amount();
assert_eq!(amount, 5_000);
}

#[test]
fn claimable_amount_within_budget() {
let env = Env::default();
let (_client, _, _) = setup(&env);
let (client, _, _) = setup(&env);
env.ledger().set_timestamp(600);
// Since claimable_amount doesn't exist, just test that the contract is callable
// The actual implementation would be in the contract logic
let claimable = client.claimable_amount();
assert_eq!(claimable, 5_000);
}

// -----------------------------------------------------------------------
Expand All @@ -103,8 +103,8 @@ mod tests {
let env = Env::default();
let (client, _, _) = setup(&env);
env.ledger().set_timestamp(600);
// The claim method returns (), not a value, so just test that it can be called
client.claim();
let claimed = client.claim();
assert!(claimed > 0);
}

#[test]
Expand All @@ -113,7 +113,7 @@ mod tests {
let (client, _, _) = setup(&env);
// Beyond duration end (100 + 1000 = 1100)
env.ledger().set_timestamp(1200);
// The claim method returns (), not a value, so just test that it can be called
client.claim();
let claimed = client.claim();
assert_eq!(claimed, 10_000);
}
}
Loading
Loading