SubstrateChess / pallet-chess

The Unlicense
11 stars 6 forks source link

Check if match is expired when making a move #32

Open AlexD10S opened 1 year ago

AlexD10S commented 1 year ago

In the extrinsic make_move() we should depends on the MatchStyle check if the move we are trying to make is out of time. This check is done already in the clear_abandoned_match extrinsic. Should be done added in make_move() too and in case of its expired make the origin of the extrinsic lose the match.

For that is checking last_move, not sure if we should check this or if we have to store the block number when the match started. It depends of the time control, for example in Chess.com a Blitz time control it refers to the time per match (not per move): https://www.chess.com/terms/chess-time-controls#blitz