Refactor production request handling: implement queuing mechanism and improve production application logic

This commit is contained in:
Kirill
2026-10-08 22:19:29 +03:00
parent 02c9843e1b
commit 00b6192d19
7 changed files with 107 additions and 39 deletions
+8
View File
@@ -72,6 +72,14 @@ func run() -> void:
check((E.eq(world.state.amount.H, 6) and E.eq(world.state.amount.S, 4)), "Exact cost and binding")
check(E.eq(world.state.auto_resources.H, 6), "Exact automatic budget")
check((E.eq(old_batches[0].amount, 10) and E.eq(world.state.batches.H[0].amount, 6)), "Consumed batches isolated")
for member in world.catalog.members("Star"): world.state.amount[member] = 0
var star_stocks: Array = ["1234567890123456789", "876543210987654321", "3141592653589793238", "2718281828459045235", "1414213562373095048", "1732050807568877293", "2236067977499789696", "2449489742783178098", "3162277660168379331"]
for i in star_stocks.size(): world.state.amount[world.catalog.members("Star")[i]] = E.of(star_stocks[i])
var scd_request: Variant = E.of("1e15")
var scd_created: Variant = world.production.produce("SCD", scd_request)
check(E.eq(scd_created, scd_request), "Large SCD production distributes a whole star quota exactly")
check(E.eq(world.state.amount.SCD, scd_request), "Large SCD creation is committed")
print(("Transaction: %d checks, %d failures" % [checks, failures]))
dispose(world)
quit((1 if failures else 0))