Changed s_players array to mapping(uint256 => address) private s_playersMappinguint256 private s_playersCount, along with the implementation in the fulfillRandomWords. Now instead of working with arrays, contract uses mapping so chainlink VRF does not run out of gas in case there are a lot of players (running out of gas due to new address[](0) operation, now it is just changing the counter s_playersCount = 0 for fixed gas).
Modified test case not to call the array values just to keep it complete.
Changed
s_players
array tomapping(uint256 => address) private s_playersMapping
uint256 private s_playersCount
, along with the implementation in thefulfillRandomWords
. Now instead of working with arrays, contract uses mapping so chainlink VRF does not run out of gas in case there are a lot of players (running out of gas due tonew address[](0)
operation, now it is just changing the counters_playersCount = 0
for fixed gas).Modified test case not to call the array values just to keep it complete.