Closed noyyyy closed 1 year ago
Now, we use getUniqueEntity to generate key when place a hero to board. It's unpredictable and not deterministic. So we can not use optimistic rendering.
getUniqueEntity
I suggest use the following pattern to generate hero key
keccak256(abi.encode(userAddress, gameId, orderOfHeroOnboard))
Accordingly, we need to delete data in table Hero when place piece back to inventory.
Hero
Will use abi.encodePacked(userAddress, orderOfHeroOnboard) instead
abi.encodePacked(userAddress, orderOfHeroOnboard)
Now, we use
getUniqueEntity
to generate key when place a hero to board. It's unpredictable and not deterministic. So we can not use optimistic rendering.I suggest use the following pattern to generate hero key
Accordingly, we need to delete data in table
Hero
when place piece back to inventory.