Skip to content

Commit 88b20ab

Browse files
committed
test: use Prague.Instance directly instead of spec provider lookups
Address PR review feedback from flcl42.
1 parent 24baf90 commit 88b20ab

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Nethermind/Nethermind.Consensus.Test/Processing/SlowBlockIntegrationTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private Block CreateBlock(params Transaction[] txs) =>
6868
private void DeployCode(Address address, byte[] code)
6969
{
7070
_worldState.CreateAccountIfNotExists(address, 0);
71-
_worldState.InsertCode(address, code, _specProvider.GetSpec(ForkActivation.TimestampOnly(MainnetSpecProvider.PragueBlockTimestamp)));
71+
_worldState.InsertCode(address, code, Prague.Instance);
7272
}
7373

7474
private SlowBlockLogEntry Execute(Transaction tx, Block block)
@@ -117,7 +117,7 @@ public void SLOAD_tracks_storage_reads()
117117
byte[] code = Prepare.EvmCode.Op(Instruction.PUSH0).Op(Instruction.SLOAD).Op(Instruction.POP).Op(Instruction.STOP).Done;
118118
DeployCode(contract, code);
119119
_worldState.Set(new StorageCell(contract, 0), new byte[] { 0x42 });
120-
_worldState.Commit(_specProvider.GetSpec(ForkActivation.TimestampOnly(MainnetSpecProvider.PragueBlockTimestamp)));
120+
_worldState.Commit(Prague.Instance);
121121

122122
Transaction tx = Build.A.Transaction.WithTo(contract).WithGasLimit(100_000)
123123
.SignedAndResolved(_ecdsa, sender, true).TestObject;
@@ -142,7 +142,7 @@ public void SSTORE_tracks_storage_writes_and_deletions()
142142
.Op(Instruction.STOP).Done;
143143
DeployCode(contract, code);
144144
_worldState.Set(new StorageCell(contract, 1), new byte[] { 0xFF });
145-
_worldState.Commit(_specProvider.GetSpec(ForkActivation.TimestampOnly(MainnetSpecProvider.PragueBlockTimestamp)));
145+
_worldState.Commit(Prague.Instance);
146146

147147
Transaction tx = Build.A.Transaction.WithTo(contract).WithGasLimit(200_000)
148148
.SignedAndResolved(_ecdsa, sender, true).TestObject;
@@ -204,7 +204,7 @@ public void EIP7702_delegation_clear_tracked()
204204
Eip7702Constants.DelegationHeader.CopyTo(existingDelegation);
205205
codeSource.Bytes.CopyTo(existingDelegation, 3);
206206
_worldState.CreateAccount(signer.Address, 0);
207-
_worldState.InsertCode(signer.Address, existingDelegation, _specProvider.GetSpec(ForkActivation.TimestampOnly(MainnetSpecProvider.PragueBlockTimestamp)));
207+
_worldState.InsertCode(signer.Address, existingDelegation, Prague.Instance);
208208
_worldState.IncrementNonce(signer.Address);
209209

210210
Transaction clearTx = Build.A.Transaction.WithType(TxType.SetCode).WithTo(signer.Address).WithGasLimit(100_000)

src/Nethermind/Nethermind.Evm.Test/MetricsIntegrationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public void SSTORE_zero_increments_storage_deleted_metric()
120120
_worldState.CreateAccount(sender.Address, 10.Ether);
121121
DeployCode(contract, Prepare.EvmCode.Op(Instruction.PUSH0).Op(Instruction.PUSH0).Op(Instruction.SSTORE).Done);
122122
_worldState.Set(new StorageCell(contract, 0), new byte[] { 0x42 });
123-
_worldState.Commit(_specProvider.GetSpec(ForkActivation.TimestampOnly(MainnetSpecProvider.PragueBlockTimestamp)));
123+
_worldState.Commit(Prague.Instance);
124124

125125
long startDeleted = Metrics.ThreadLocalStorageDeleted;
126126

@@ -177,7 +177,7 @@ public void EIP7702_delegation_clear_increments_metric()
177177
Eip7702Constants.DelegationHeader.CopyTo(existingDelegation);
178178
TestItem.AddressC.Bytes.CopyTo(existingDelegation, 3);
179179
_worldState.CreateAccount(signer.Address, 0);
180-
_worldState.InsertCode(signer.Address, existingDelegation, _specProvider.GetSpec(ForkActivation.TimestampOnly(MainnetSpecProvider.PragueBlockTimestamp)));
180+
_worldState.InsertCode(signer.Address, existingDelegation, Prague.Instance);
181181
_worldState.IncrementNonce(signer.Address);
182182

183183
long startCleared = Metrics.ThreadLocalEip7702DelegationsCleared;

0 commit comments

Comments
 (0)