Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <[email protected]>
  • Loading branch information
garyschulte committed Dec 9, 2023
1 parent a243c82 commit 60bf224
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public class TxParseSubCommand implements Runnable {
arity = "1..1",
description = "file to read transaction data lines from, otherwise defaults to stdin")
private String corpusFile = null;
static final BigInteger halfCurveOrder = SignatureAlgorithmFactory.getInstance().getHalfCurveOrder();

static final BigInteger halfCurveOrder =
SignatureAlgorithmFactory.getInstance().getHalfCurveOrder();
static final BigInteger chainId = new BigInteger("1", 10);

private final PrintWriter out;
Expand Down Expand Up @@ -106,7 +108,7 @@ void dump(final Bytes tx) {
var transaction = TransactionDecoder.decodeOpaqueBytes(tx, EncodingContext.BLOCK_BODY);

// https://github.com/hyperledger/besu/blob/5fe49c60b30fe2954c7967e8475c3b3e9afecf35/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidator.java#L252
if (transaction.getChainId().isPresent() && !transaction.getChainId().get().equals(chainId) ){
if (transaction.getChainId().isPresent() && !transaction.getChainId().get().equals(chainId)) {
throw new Exception("wrong chain id");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void assertValidRlp() {
}

@Test
public void assertInvalidChainId(){
public void assertInvalidChainId() {
txParseSubCommand.dump(
Bytes.fromHexString(
"0xf901fc303083303030803030b901ae30303030303030303030433030303030303030303030303030303030303030303030303030303030203030413030303030303030303000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000038390030000000002800380000413159000021000000002b0000000000003800000000003800000000000000000000002b633279315a00633200303041374222610063416200325832325a002543323861795930314130383058435931317a633043304239623900310031254363384361000023433158253041380037000027285839005a007937000000623700002761002b5a003937622e000000006300007863410000002a2e320000000000005a0000000000000037242778002039006120412e6362002138300000002a313030303030303030303030373030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030a03030303030303030303030303030303030303030303030303030303030303030a03030303030303030303030303030303030303030303030303030303030303030"));
Expand Down

0 comments on commit 60bf224

Please sign in to comment.