fifa17-recon: transfer market sell/list flow (stateful, tested)
Complete the market loop (browse + buy + sell). POST auctionhouse (FutISStart)
lists an owned club item -> profile.listings + returns {id:tradeId}. tradePile
builds a validated auction record per listing from the owned item + prices
(freeze-safe, same 0x18013e410 shape). DELETE trade/{id} removes the listing.
fut_store gains list_for_sale/listings/remove_listing (tradeId space 900500000+).
test_market_buy.py extended with sell/delist checks (temp profile, no real-save
mutation): list -> tradePile shows it with prices -> delist empties it. All pass.
Read-only contract suite still 311/311. Functional (FIFA's exact sell params)
pending live test; freeze-safe by construction.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PN5bmpDVQR1aXgefyWAt7o
This commit is contained in:
@@ -62,8 +62,26 @@ def main():
|
||||
ok("insufficient funds -> 461", c2 == 461, str(c2))
|
||||
ok("coins unchanged on failed buy", u.STORE.coins() == 10, str(u.STORE.coins()))
|
||||
|
||||
# ---- SELL / list flow ----
|
||||
owned_id = u.STORE.items()[0]["id"]
|
||||
_, s = u.auctionhouse_route(FakeH("POST", "/ut/game/fifa17/auctionhouse",
|
||||
json.dumps({"itemData": {"id": owned_id}, "startingBid": 1000, "buyNowPrice": 5000}).encode()))
|
||||
ltid = s.get("id")
|
||||
ok("list returns a tradeId", isinstance(ltid, int), repr(s))
|
||||
_, tp = u.tradepile_route(FakeH("GET", "/ut/game/fifa17/tradePile"))
|
||||
ok("tradePile shows the listing", tp.get("total") == 1, repr(tp.get("total")))
|
||||
if tp.get("auctionInfo"):
|
||||
rec = tp["auctionInfo"][0]
|
||||
ok("listing tradeId matches", rec.get("tradeId") == ltid)
|
||||
ok("listing buyNowPrice preserved", rec.get("buyNowPrice") == 5000)
|
||||
ok("listing itemData is object", isinstance(rec.get("itemData"), dict))
|
||||
ok("listing itemData.attributeList is array", isinstance(rec.get("itemData", {}).get("attributeList"), list))
|
||||
u.delete_trade_route(FakeH("DELETE", f"/ut/delete/game/fifa17/trade/{ltid}"))
|
||||
_, tp2 = u.tradepile_route(FakeH("GET", "/ut/game/fifa17/tradePile"))
|
||||
ok("delist empties tradePile", tp2.get("total") == 0, repr(tp2.get("total")))
|
||||
|
||||
os.remove(os.environ["FUT_PROFILE"])
|
||||
print(f"{'PASS' if not fails else 'FAIL'} - market buy flow "
|
||||
print(f"{'PASS' if not fails else 'FAIL'} - market buy+sell flow "
|
||||
f"({0 if fails else 'all'} checks; {len(fails)} failed)")
|
||||
for f in fails:
|
||||
print(" FAIL:", f)
|
||||
|
||||
Reference in New Issue
Block a user