SubstrateChess / pallet-chess

The Unlicense
11 stars 6 forks source link

calculate weights for on_initialize #11

Closed bernardoaraujor closed 1 year ago

bernardoaraujor commented 1 year ago

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:

lana-shanghai commented 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.

bernardoaraujor commented 1 year ago

closed via #15 and #16