Hi, wondering how we could test whether the other accounts pass as recentWinner when setting our STATIC_RNG to 778.
Right now we use 777 as the random value which with 3 players equals to index 0 therefore our standard account.
I also want to test if another index can be the winner or only our standard account.
Right now it is unclear if the test is indeed doing what we want and not only passing the standard account if selected as winner, right?
I tried below but but that throws a TypeError: 'Account' object is not subscriptable so I might just not know how to get the other added players index:
(Around the 08:10:00 mark in the tutorial video.)
Hi, wondering how we could test whether the other accounts pass as recentWinner when setting our STATIC_RNG to 778.
Right now we use 777 as the random value which with 3 players equals to index 0 therefore our standard account. I also want to test if another index can be the winner or only our standard account.
Right now it is unclear if the test is indeed doing what we want and not only passing the standard account if selected as winner, right?
I tried below but but that throws a
TypeError: 'Account' object is not subscriptable
so I might just not know how to get the other added players index:I also tried to use
lottery.players
to get a players address but that does not work.The full code of that test: