Closed bernardoaraujor closed 1 year ago
Suggestion to get rid of the on_initialize
hook: add an extrinsic that a player can call to win the game and retrieve the deposit from both players, if the opponent's time to make a move has expired.
closed via #15 and #16
on_initialize
needs to return its consumed weight.currently, there's no upper bound on the amount of ongoing matches. since
on_initialize
iterates over all matches, there's no upper bound on the maximum possible weight to be consumed.todo:
Config
typeMaxOngoingMatches: Get<u32>
StorageValue
calledMatchCounter
MatchCounter
when appropriatecreate_match
verifying whetherMatchCounter <= MaxOngoingMatches::get()