@@ -51,6 +51,7 @@ public class TracedAccessWorldStateTests(bool parallel)
5151
5252 BlockHeader baseBlock = Build . A . BlockHeader . WithStateRoot ( stateRoot ) . WithNumber ( 0 ) . TestObject ;
5353 TracedAccessWorldState tws = new ( inner , parallel : parallel ) ;
54+ tws . SetGeneratingBlockAccessList ( new ( ) ) ;
5455 IDisposable scope = tws . BeginScope ( baseBlock ) ;
5556 tws . SetIndex ( 0 ) ;
5657 return ( tws , scope ) ;
@@ -74,7 +75,7 @@ public void BalanceOp_RecordsBalanceChange(
7475 tws . SubtractFromBalance ( TestItem . AddressA , delta , Spec , out _ ) ;
7576 }
7677
77- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
78+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
7879 using ( Assert . EnterMultipleScope ( ) )
7980 {
8081 Assert . That ( ac , Is . Not . Null ) ;
@@ -102,7 +103,7 @@ public void NonceOp_RecordsNonceChange(
102103 tws . SetNonce ( TestItem . AddressA , value ) ;
103104 }
104105
105- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
106+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
106107 using ( Assert . EnterMultipleScope ( ) )
107108 {
108109 Assert . That ( ac , Is . Not . Null ) ;
@@ -123,7 +124,7 @@ public void InsertCode_RecordsCodeChange()
123124 ValueHash256 codeHash = ValueKeccak . Compute ( code ) ;
124125 tws . InsertCode ( TestItem . AddressA , codeHash , code , Spec ) ;
125126
126- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
127+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
127128 using ( Assert . EnterMultipleScope ( ) )
128129 {
129130 Assert . That ( ac , Is . Not . Null ) ;
@@ -143,7 +144,7 @@ public void Set_RecordsStorageChange()
143144 {
144145 tws . Set ( cell , [ 0x01 ] ) ;
145146
146- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
147+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
147148 using ( Assert . EnterMultipleScope ( ) )
148149 {
149150 Assert . That ( ac , Is . Not . Null ) ;
@@ -168,7 +169,7 @@ public void StorageRead_RecordsStorageRead(bool useGetOriginal)
168169 _ = tws . GetOriginal ( cell ) ;
169170 }
170171
171- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
172+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
172173 Assert . That ( ac , Is . Not . Null ) ;
173174 Assert . That ( ac ! . StorageReads , Has . Count . EqualTo ( 1 ) ) ;
174175 Assert . That ( ac . StorageReads . First ( ) , Is . EqualTo ( ( UInt256 ) 2 ) ) ;
@@ -259,7 +260,7 @@ public void ReadOp_RecordsAccountRead(Action<IWorldState> setup, Action<TracedAc
259260 using ( Assert . EnterMultipleScope ( ) )
260261 {
261262 readAndAssert ( tws ) ;
262- Assert . That ( tws . GetGeneratingBlockAccessList ( ) . HasAccount ( TestItem . AddressA ) , Is . True ) ;
263+ Assert . That ( tws . GetGeneratingBlockAccessList ( ) ! . HasAccount ( TestItem . AddressA ) , Is . True ) ;
263264 }
264265 }
265266 }
@@ -274,7 +275,7 @@ public void CreateAccount_RecordsChanges(
274275 {
275276 tws . CreateAccount ( TestItem . AddressA , balance , nonce ) ;
276277
277- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
278+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
278279 using ( Assert . EnterMultipleScope ( ) )
279280 {
280281 Assert . That ( ac , Is . Not . Null ) ;
@@ -302,7 +303,7 @@ public void DeleteAccount_RecordsBalanceZeroed()
302303 {
303304 tws . DeleteAccount ( TestItem . AddressA ) ;
304305
305- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
306+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
306307 Assert . That ( ac , Is . Not . Null ) ;
307308 using ( Assert . EnterMultipleScope ( ) )
308309 {
@@ -321,8 +322,8 @@ public void AddAccountRead_AddsAccountToBAL()
321322 {
322323 tws . AddAccountRead ( TestItem . AddressA ) ;
323324
324- Assert . That ( tws . GetGeneratingBlockAccessList ( ) . HasAccount ( TestItem . AddressA ) , Is . True ) ;
325- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
325+ Assert . That ( tws . GetGeneratingBlockAccessList ( ) ! . HasAccount ( TestItem . AddressA ) , Is . True ) ;
326+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
326327 using ( Assert . EnterMultipleScope ( ) )
327328 {
328329 Assert . That ( ac ! . BalanceChanges , Is . Empty ) ;
@@ -341,13 +342,13 @@ public void TakeSnapshot_Restore_RollsBackBalanceChange()
341342 Snapshot snap = tws . TakeSnapshot ( ) ;
342343 tws . AddToBalance ( TestItem . AddressA , 50 , Spec , out _ ) ;
343344
344- Assert . That ( tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) !
345+ Assert . That ( tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) !
345346 . BalanceChanges , Has . Count . EqualTo ( 1 ) ) ;
346347
347348 tws . Restore ( snap ) ;
348349
349350 // Balance change must be rolled back by the snapshot restore.
350- Assert . That ( tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) !
351+ Assert . That ( tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) !
351352 . BalanceChanges , Is . Empty ) ;
352353 }
353354 }
@@ -360,7 +361,7 @@ public void SubtractFromBalance_DoesNotRecordSystemUserZeroChange()
360361 {
361362 tws . SubtractFromBalance ( Address . SystemUser , 0u , Spec , out _ ) ;
362363
363- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( Address . SystemUser ) ;
364+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( Address . SystemUser ) ;
364365 Assert . That ( ac , Is . Null ) ;
365366 }
366367 }
@@ -381,7 +382,7 @@ public void RepeatedBalanceChanges_SameTx_UsesLatestBalValue()
381382 tws . AddToBalance ( TestItem . AddressA , 100 , Spec , out UInt256 oldBalance1 ) ;
382383 tws . AddToBalance ( TestItem . AddressA , 100 , Spec , out UInt256 oldBalance2 ) ;
383384
384- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
385+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
385386 using ( Assert . EnterMultipleScope ( ) )
386387 {
387388 Assert . That ( oldBalance1 , Is . EqualTo ( ( UInt256 ) 1000 ) , "first old balance from inner state" ) ;
@@ -404,7 +405,7 @@ public void RepeatedNonceChanges_SameTx_UsesLatestNonceValue()
404405 tws . IncrementNonce ( TestItem . AddressA , 1 , out UInt256 oldNonce1 ) ;
405406 tws . IncrementNonce ( TestItem . AddressA , 1 , out UInt256 oldNonce2 ) ;
406407
407- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
408+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
408409 using ( Assert . EnterMultipleScope ( ) )
409410 {
410411 Assert . That ( oldNonce1 , Is . EqualTo ( ( UInt256 ) 0 ) , "first old nonce from inner" ) ;
@@ -429,7 +430,7 @@ public void RepeatedCodeChanges_SameTx_UsesLatestCode()
429430 // Second InsertCode should see code1 as old code (from BAL), not empty (from inner)
430431 tws . InsertCode ( TestItem . AddressA , ValueKeccak . Compute ( code2 ) , code2 , Spec ) ;
431432
432- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
433+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
433434 using ( Assert . EnterMultipleScope ( ) )
434435 {
435436 Assert . That ( ac , Is . Not . Null ) ;
@@ -453,7 +454,7 @@ public void RepeatedStorageWrites_SameTx_UsesLatestValue_InParallel()
453454 tws . Set ( cell , [ 0x01 ] ) ;
454455 tws . Set ( cell , [ 0x02 ] ) ;
455456
456- AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) . GetAccountChanges ( TestItem . AddressA ) ;
457+ AccountChanges ? ac = tws . GetGeneratingBlockAccessList ( ) ! . GetAccountChanges ( TestItem . AddressA ) ;
457458 using ( Assert . EnterMultipleScope ( ) )
458459 {
459460 Assert . That ( ac , Is . Not . Null ) ;
0 commit comments