Open lekevicius opened 6 months ago
Overall lgtm, but we should probably add some tests!
There are no tests for the entire new system yet, will work on that once we feature-freeze. Not ideal, but main branch won't be merged until we have full test coverage.
Purchase Orders aim to solve potential ruggability of Orbs.
Problem: Orb could get abandoned at any point, even if there’s a pledge. If you purchase the Orb before its cooldown expires, then you might never get to ask a question (or claim the pledge, as it goes to the last invoker), despite paying for the Orb.
Solution: replacing immediate purchases with purchase orders while Orb is charging, holding these funds until Orb is invokable, and then executing the purchase. If the pledge is claimed, or Orb does not become invokable until an expiration date, then the order is cancelled, and funds are returned to the purchasers.
Additional mechanics: