Save the scheduler to disk

This is a horrible impl which does a full ser of everything on every change.
It's just the minimal changes to resolve this TODO and able testnet deployment.
This commit is contained in:
Luke Parker
2023-07-30 14:11:04 -04:00
parent d8033504c8
commit 2815046b21
5 changed files with 144 additions and 29 deletions

View File

@@ -49,10 +49,15 @@ pub async fn test_wallet<C: Coin>(coin: C) {
}
};
let mut scheduler = Scheduler::new(key);
let mut txn = db.txn();
let mut scheduler = Scheduler::new::<MemDb>(&mut txn, key);
let amount = 2 * C::DUST;
let plans = scheduler
.schedule(outputs.clone(), vec![Payment { address: C::address(key), data: None, amount }]);
let plans = scheduler.schedule::<MemDb>(
&mut txn,
outputs.clone(),
vec![Payment { address: C::address(key), data: None, amount }],
);
txn.commit();
assert_eq!(
plans,
vec![Plan {