Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ak88 committed Oct 23, 2024
1 parent 0f76f46 commit 5c98318
Showing 1 changed file with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -600,29 +600,6 @@ public void IsWellFormed_NullAuthorizationList_ReturnsFalse()
Assert.That(txValidator.IsWellFormed(tx, Prague.Instance).AsBool, Is.False);
}

private static object[] BadSignatures =
{
new object[] { 1ul, (UInt256)1, Secp256K1Curve.HalfNPlusOne, false},
new object[] { 1ul, UInt256.Zero, Secp256K1Curve.HalfN, true },
new object[] { 0ul, UInt256.Zero, UInt256.Zero, true },
};
[TestCaseSource(nameof(BadSignatures))]
public void IsWellFormed_AuthorizationTupleHasBadSignature_ReturnsFalse(ulong yParity, UInt256 r, UInt256 s, bool expected)
{
TransactionBuilder<Transaction> txBuilder = Build.A.Transaction
.WithType(TxType.SetCode)
.WithTo(TestItem.AddressA)
.WithAuthorizationCode(new AuthorizationTuple(0, Address.Zero, 0, new Signature(r, s, yParity + Signature.VOffset)))
.WithMaxFeePerGas(100000)
.WithGasLimit(1000000)
.WithChainId(TestBlockchainIds.ChainId)
.SignedAndResolved();

Transaction tx = txBuilder.TestObject;
TxValidator txValidator = new(TestBlockchainIds.ChainId);

Assert.That(txValidator.IsWellFormed(tx, Prague.Instance).AsBool, Is.EqualTo(expected));
}
private static IEnumerable<TxType> NonSetCodeTypes() =>
Enum.GetValues<TxType>().Where(t => t != TxType.SetCode && t != TxType.DepositTx);

Expand Down

0 comments on commit 5c98318

Please sign in to comment.