public async Task BlockProducer_has_blocks_with_zero_base_fee_before_fork() { BaseFeeTestScenario.ScenarioBuilder scenario = BaseFeeTestScenario.GoesLikeThis() .WithEip1559TransitionBlock(5) .CreateTestBlockchain() .BlocksBeforeTransitionShouldHaveZeroBaseFee(); await scenario.Finish(); }
public async Task BlockProducer_returns_correct_fork_base_fee() { BaseFeeTestScenario.ScenarioBuilder scenario = BaseFeeTestScenario.GoesLikeThis() .WithEip1559TransitionBlock(7) .CreateTestBlockchain() .BlocksBeforeTransitionShouldHaveZeroBaseFee() .AssertNewBlock(Eip1559Constants.ForkBaseFee); await scenario.Finish(); }
public async Task BlockProducer_returns_correctly_decreases_base_fee_on_empty_blocks() { BaseFeeTestScenario.ScenarioBuilder scenario = BaseFeeTestScenario.GoesLikeThis() .WithEip1559TransitionBlock(6) .CreateTestBlockchain() .BlocksBeforeTransitionShouldHaveZeroBaseFee() .AssertNewBlock(Eip1559Constants.ForkBaseFee) .AssertNewBlock(875000000) .AssertNewBlock(765625000) .AssertNewBlock(669921875) .AssertNewBlock(586181641); await scenario.Finish(); }
public async Task FeeCollector_should_not_collect_burned_fees_when_eip1559_is_not_set() { long gasTarget = 3000000; BaseFeeTestScenario.ScenarioBuilder scenario = BaseFeeTestScenario.GoesLikeThis() .WithEip1559FeeCollector(TestItem.AddressE) .CreateTestBlockchain(gasTarget) .DeployContract() .BlocksBeforeTransitionShouldHaveZeroBaseFee() .SendLegacyTransaction(gasTarget / 2, 20.GWei()) .SendEip1559Transaction(gasTarget / 2, 1.GWei(), 20.GWei()) .SendLegacyTransaction(gasTarget / 2, 20.GWei()) .AssertNewBlockFeeCollected(0); await scenario.Finish(); }
public async Task When_base_fee_decreases_previously_fee_too_low_transaction_is_included() { long gasTarget = 3000000; BaseFeeTestScenario.ScenarioBuilder scenario = BaseFeeTestScenario.GoesLikeThis() .WithEip1559TransitionBlock(6) .CreateTestBlockchain(gasTarget) .BlocksBeforeTransitionShouldHaveZeroBaseFee() .AssertNewBlock(Eip1559Constants.ForkBaseFee) .SendLegacyTransaction(gasTarget / 2, 7.GWei() / 10, nonce: UInt256.Zero) .AssertNewBlock(875000000) .AssertNewBlock(765625000) .AssertNewBlock(669921875) // added tx in 9th block .AssertNewBlock(628051758); await scenario.Finish(); }
public async Task BaseFee_should_not_change_when_we_send_transactions_equal_gas_target() { long gasTarget = 3000000; BaseFeeTestScenario.ScenarioBuilder scenario = BaseFeeTestScenario.GoesLikeThis() .WithEip1559TransitionBlock(6) .CreateTestBlockchain(gasTarget) .DeployContract() .BlocksBeforeTransitionShouldHaveZeroBaseFee() .AssertNewBlock(Eip1559Constants.ForkBaseFee) .SendLegacyTransaction(gasTarget / 2, 20.GWei()) .SendEip1559Transaction(gasTarget / 2, 1.GWei(), 20.GWei()) .AssertNewBlock(875000000) .AssertNewBlock(875000000) .AssertNewBlockWithDecreasedBaseFee(); await scenario.Finish(); }