Skip to content

Commit

Permalink
Copy timestamp from json (#5731)
Browse files Browse the repository at this point in the history
  • Loading branch information
deffrian authored and rubo committed May 25, 2023
1 parent a7684db commit 22c0090
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ public void Chiado_loads_properly()
Assert.AreEqual(ChiadoSpecProvider.Instance.TerminalTotalDifficulty, provider.TerminalTotalDifficulty);
Assert.AreEqual(BlockchainIds.Chiado, provider.ChainId);
Assert.AreEqual(BlockchainIds.Chiado, provider.NetworkId);

provider.GetSpec((1, ChiadoSpecProvider.ShanghaiTimestamp - 1)).MaxCodeSize.Should().Be(long.MaxValue);
provider.GetSpec((1, ChiadoSpecProvider.ShanghaiTimestamp)).MaxCodeSize.Should().Be(24576L);
provider.GetSpec((1, ChiadoSpecProvider.ShanghaiTimestamp)).MaxInitCodeSize.Should().Be(2 * 24576L);
}


Expand Down Expand Up @@ -312,6 +316,8 @@ public void Mainnet_loads_properly()
};

CompareSpecProviders(mainnet, provider, forkActivationsToTest, CompareSpecsOptions.CheckDifficultyBomb);
provider.GetSpec((MainnetSpecProvider.SpuriousDragonBlockNumber, null)).MaxCodeSize.Should().Be(24576L);
provider.GetSpec((MainnetSpecProvider.SpuriousDragonBlockNumber, null)).MaxInitCodeSize.Should().Be(2 * 24576L);

Assert.AreEqual(MainnetSpecProvider.LondonBlockNumber, provider.GenesisSpec.Eip1559TransitionBlock);
Assert.AreEqual(0_000_000, provider.GetSpec((ForkActivation)4_369_999).DifficultyBombDelay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private void LoadParameters(ChainSpecJson chainSpecJson, ChainSpec chainSpec)
MinGasLimit = chainSpecJson.Params.MinGasLimit ?? 5000,
MaxCodeSize = chainSpecJson.Params.MaxCodeSize,
MaxCodeSizeTransition = chainSpecJson.Params.MaxCodeSizeTransition,
MaxCodeSizeTransitionTimestamp = chainSpecJson.Params.MaxCodeSizeTransitionTimestamp,
Registrar = chainSpecJson.Params.EnsRegistrar,
ForkBlock = chainSpecJson.Params.ForkBlock,
ForkCanonHash = chainSpecJson.Params.ForkCanonHash,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ internal class ChainSpecParamsJson

public long? MaxCodeSizeTransition { get; set; }

public ulong? MaxCodeSizeTransitionTimestamp { get; set; }

public long? Eip140Transition { get; set; }

public long? Eip211Transition { get; set; }
Expand Down

0 comments on commit 22c0090

Please sign in to comment.