-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathpatch3.py
More file actions
27 lines (21 loc) · 859 Bytes
/
Copy pathpatch3.py
File metadata and controls
27 lines (21 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
test_path = 'contracts/accountability_vault/src/test.rs'
with open(test_path, 'w') as f:
f.write('''#![cfg(test)]
use super::*;
use soroban_sdk::{testutils::{Address as _, Events, Ledger}, Address, Env};
#[test]
fn test_dispute() {
let env = Env::default();
// Set a mock timestamp for the ledger
env.ledger().set_timestamp(1690000000);
let contract_id = env.register_contract(None, AccountabilityVault);
let client = AccountabilityVaultClient::new(&env, &contract_id);
let creator = Address::generate(&env);
env.mock_all_auths();
// Call with index 1 and a dispute window of 3600 seconds (1 hour)
client.dispute_milestone(&creator, &1u32, &3600u64);
assert_eq!(env.events().all().len(), 1);
}
''')
print('Patch 3 applied: Test file updated for dispute_window and ledger timestamp.')