@Test public void testAcceptTransactionWithSignature() throws Exception { Transaction tx = Transaction.create( "3535353535353535353535353535353535353535", new BigInteger("1000000000000000000"), new BigInteger("9"), new BigInteger("20000000000"), new BigInteger("21000"), 1); ECKey ecKey = ECKey.fromPrivate(Hex.decode("4646464646464646464646464646464646464646464646464646464646464646")); tx.sign(ecKey); TestBlockchainConfig parent = new TestBlockchainConfig(); Eip160HFConfig config = new Eip160HFConfig(parent); assertTrue(config.acceptTransactionSignature(tx)); }
@Override public boolean acceptTransactionSignature(Transaction tx) { if (tx.getSignature() == null) return false; if (!tx.getSignature().validateComponents() || tx.getSignature().s.compareTo(SECP256K1N_HALF) > 0) return false; return tx.getChainId() == null || Objects.equals(getChainId(), tx.getChainId()); }
Eip160HFConfig extends Eip150HFConfig { @Override public boolean acceptTransactionSignature(Transaction tx) { if (tx.getSignature() == null) return false; if (!tx.getSignature().validateComponents() || tx.getSignature().s.compareTo(SECP256K1N_HALF) > 0) return false; return tx.getChainId() == null || Objects.equals(getChainId(), tx.getChainId()); } }
Eip160HFConfig extends Eip150HFConfig { @Override public boolean acceptTransactionSignature(Transaction tx) { if (tx.getSignature() == null) return false; if (!tx.getSignature().validateComponents() || tx.getSignature().s.compareTo(SECP256K1N_HALF) > 0) return false; return tx.getChainId() == null || Objects.equals(getChainId(), tx.getChainId()); } Eip160HFConfig(BlockchainConfig parent); }
Eip160HFConfig extends Eip150HFConfig { @Override public boolean acceptTransactionSignature(Transaction tx) { if (tx.getSignature() == null) return false; if (!tx.getSignature().validateComponents() || tx.getSignature().s.compareTo(SECP256K1N_HALF) > 0) return false; return tx.getChainId() == null || Objects.equals(getChainId(), tx.getChainId()); } Eip160HFConfig(BlockchainConfig parent); @Override GasCost getGasCost(); @Override boolean eip161(); @Override Integer getChainId(); @Override Constants getConstants(); @Override boolean acceptTransactionSignature(Transaction tx); }
Eip160HFConfig extends Eip150HFConfig { @Override public boolean acceptTransactionSignature(Transaction tx) { if (tx.getSignature() == null) return false; if (!tx.getSignature().validateComponents() || tx.getSignature().s.compareTo(SECP256K1N_HALF) > 0) return false; return tx.getChainId() == null || Objects.equals(getChainId(), tx.getChainId()); } Eip160HFConfig(BlockchainConfig parent); @Override GasCost getGasCost(); @Override boolean eip161(); @Override Integer getChainId(); @Override Constants getConstants(); @Override boolean acceptTransactionSignature(Transaction tx);  }