diff --git a/.gitignore b/.gitignore index 5554c2e..3ef2fcf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # Rust target -sharpy -test_snapshots// +/sharpy +test_snapshots/ Cargo.lock *.rlib *.so diff --git a/contracts/sharpy/src/lib.rs b/contracts/sharpy/src/lib.rs index d2a077e..54e4e87 100644 --- a/contracts/sharpy/src/lib.rs +++ b/contracts/sharpy/src/lib.rs @@ -43,6 +43,8 @@ fn load_invoice(env: &Env, id: u64) -> Invoice { fn save_invoice(env: &Env, id: u64, invoice: &Invoice) { env.storage().persistent().set(&invoice_key(id), invoice); + // Extend TTL to ~1 year (in ledgers at ~5s each: 365*24*3600/5 = 6_307_200) + env.storage().persistent().extend_ttl(&invoice_key(id), 100_000, 6_307_200); } fn append_audit(env: &Env, id: u64, action: Symbol, actor: &Address) {