Skip to content

Commit

Permalink
Add bad gas fields test with EIP1559 disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
emlautarom1 committed Sep 6, 2024
1 parent fff2f90 commit 5e14c71
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,26 @@ public void BlobTransactions_are_valid_with_eip4844_no_eip1559()
txValidator.IsWellFormed(tx, releaseSpec).Should().BeTrue();
}

[Test]
public void BlobTransactions_bad_gas_fields_is_valid_when_no_eip1559()
{
Transaction tx = Build.A.Transaction
.WithType(TxType.Blob)
.WithTimestamp(ulong.MaxValue)
.WithTo(TestItem.AddressA)
.WithMaxFeePerGas(1)
.WithMaxPriorityFeePerGas(2)
.WithMaxFeePerBlobGas(1)
.WithBlobVersionedHashes(1)
.WithChainId(TestBlockchainIds.ChainId)
.SignedAndResolved().TestObject;

TxValidator txValidator = new(TestBlockchainIds.ChainId);
IReleaseSpec releaseSpec = new ReleaseSpec() { IsEip4844Enabled = true, IsEip1559Enabled = false };

txValidator.IsWellFormed(tx, releaseSpec).Should().BeTrue();
}

private static byte[] MakeArray(int count, params byte[] elements) =>
elements.Take(Math.Min(count, elements.Length))
.Concat(new byte[Math.Max(0, count - elements.Length)])
Expand Down

0 comments on commit 5e14c71

Please sign in to comment.