@@ -44,13 +44,15 @@ describe("BlockHashRNG", async () => {
44
44
const trace = await network . provider . send ( "debug_traceTransaction" , [ tx . hash ] ) ;
45
45
const [ rn ] = abiCoder . decode ( [ "uint" ] , ethers . getBytes ( `${ trace . returnValue } ` ) ) ;
46
46
expect ( rn ) . to . not . equal ( 0 ) ;
47
+ await tx . wait ( ) ;
47
48
} ) ;
48
49
49
50
it ( "Should return zero for a block number in the future" , async ( ) => {
50
51
const tx = await rng . receiveRandomness ( 9876543210 ) ;
51
52
const trace = await network . provider . send ( "debug_traceTransaction" , [ tx . hash ] ) ;
52
53
const [ rn ] = abiCoder . decode ( [ "uint" ] , ethers . getBytes ( `${ trace . returnValue } ` ) ) ;
53
54
expect ( rn ) . to . equal ( 0 ) ;
55
+ await tx . wait ( ) ;
54
56
} ) ;
55
57
} ) ;
56
58
@@ -81,6 +83,7 @@ describe("ChainlinkRNG", async () => {
81
83
82
84
const rn = await rng . receiveRandomness ( 0 ) ;
83
85
expect ( rn ) . to . equal ( expectedRn ) ;
86
+ await tx . wait ( ) ;
84
87
} ) ;
85
88
86
89
it ( "Should return only the last random number when multiple requests are made" , async ( ) => {
@@ -114,6 +117,7 @@ describe("ChainlinkRNG", async () => {
114
117
// Should return only the last random number
115
118
const rn = await rng . receiveRandomness ( 0 ) ;
116
119
expect ( rn ) . to . equal ( expectedRn2 ) ;
120
+ await tx . wait ( ) ;
117
121
} ) ;
118
122
} ) ;
119
123
@@ -143,6 +147,7 @@ describe("RandomizerRNG", async () => {
143
147
144
148
const rn = await rng . receiveRandomness ( 0 ) ;
145
149
expect ( rn ) . to . equal ( expectedRn ) ;
150
+ await tx . wait ( ) ;
146
151
} ) ;
147
152
148
153
it ( "Should return only the last random number when multiple requests are made" , async ( ) => {
@@ -175,5 +180,6 @@ describe("RandomizerRNG", async () => {
175
180
// Should return only the last random number
176
181
const rn = await rng . receiveRandomness ( 0 ) ;
177
182
expect ( rn ) . to . equal ( expectedRn2 ) ;
183
+ await tx . wait ( ) ;
178
184
} ) ;
179
185
} ) ;
0 commit comments