mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user