Repository navigation
feat(individuality): register for the game in one call - #479
Conversation
📦 Bundle size impactComparing
Thresholds — 🟡 ≥10% or ≥5.0 KB · 🟠 ≥20% or ≥15.0 KB (bundled). Percentage only applies once the baseline is ≥ 10 KB. Informational — this check never blocks merge. |
|
Nice work. Seat → bind → draws → sign reads the chain before every step, so a retry picks up where it stopped. It ports cleanly from jollity, and the in-source tests cover the decisions well. One blocker and a few smaller things. Blocker: the game account index should default to 0, not be hard-coded to it Moving to 0 is right: the reason we played on 1 is gone. The native DIM2 game was switched off on Android:
It was then removed from iOS:
So this one can be closed with it:
Two things before it merges:
Smaller
|
|
Thanks Philip, addressed in a2bd8b7 and b79b4b5.
|
Adds game registration to
@parity/product-sdk-individuality, so every product that signs players up for the weekly game (Jollity's app and chat, Humanity) shares one implementation instead of its own copy. Built on the package's existing lite-signup, bind and airdrop pieces.registerForGame(chain, capabilities, options)runs seat → bind → draws → sign. It reads the chain before each step, so running it again resumes where it stopped. Draw entries never block the sign-up. It resolves at the best block by default, and an abort before the broadcast sends nothing.GameRegistrationErrorcarries a report and says which step failed and whether a retry can help (registrationRetryDelaygives the backoff).readGameSeat/deriveSeatgive the route:returning,free,depositorunfunded.bindGameSeatruns the bind on its own.GAME_PRODUCT_NAME,GAME_ACCOUNT_INDEX,gameProductIdname the game account in one place./hostentry:hostGameRegistrationCapabilities({ tld })builds the capabilities from a Polkadot host. The main entry imports neither host nor tx.Ported from jollity-next (
game-chain/src/engine.ts,protocol/src/seat.ts). Changeset inpending-changesets/(individuality +@parity/product-sdkminor).