Transaction { public void sign(byte[] privKeyBytes) throws MissingPrivateKeyException { sign(ECKey.fromPrivate(privKeyBytes)); } Transaction(byte[] rawData);  Transaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, byte[] receiveAddress, byte[] value, byte[] data,
                       Integer chainId);  Transaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, byte[] receiveAddress, byte[] value, byte[] data);  Transaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, byte[] receiveAddress, byte[] value, byte[] data,
                       byte[] r, byte[] s, byte v, Integer chainId);  Transaction(byte[] nonce, byte[] gasPrice, byte[] gasLimit, byte[] receiveAddress, byte[] value, byte[] data,
                       byte[] r, byte[] s, byte v); long transactionCost(BlockchainNetConfig config, Block block); synchronized void verify(); synchronized void rlpParse(); boolean isParsed(); byte[] getHash(); byte[] getRawHash(); byte[] getNonce(); boolean isValueTx(); byte[] getValue(); byte[] getReceiveAddress(); byte[] getGasPrice(); byte[] getGasLimit(); long nonZeroDataBytes(); long zeroDataBytes(); byte[] getData(); ECDSASignature getSignature(); byte[] getContractAddress(); boolean isContractCreation(); ECKey getKey(); synchronized byte[] getSender(); Integer getChainId(); void sign(byte[] privKeyBytes); void sign(ECKey key); @Override String toString(); String toString(int maxDataSize); byte[] getEncodedRaw(); synchronized byte[] getEncoded(); @Override int hashCode(); @Override boolean equals(Object obj); static Transaction createDefault(String to, BigInteger amount, BigInteger nonce); static Transaction createDefault(String to, BigInteger amount, BigInteger nonce, Integer chainId); static Transaction create(String to, BigInteger amount, BigInteger nonce, BigInteger gasPrice, BigInteger gasLimit); static Transaction create(String to, BigInteger amount, BigInteger nonce, BigInteger gasPrice,
                                     BigInteger gasLimit, Integer chainId); static final int HASH_LENGTH; static final int ADDRESS_LENGTH; static final MemSizeEstimator<Transaction> MemEstimator; }
@Test public void constantCallConflictTest() throws Exception { String json = "{ " + " 'test1' : { " + " 'env' : { " + " 'currentCoinbase' : '2adc25665018aa1fe0e6bc666dac8fc2697ff9ba', " + " 'currentDifficulty' : '0x0100', " + " 'currentGasLimit' : '0x0f4240', " + " 'currentNumber' : '0x00', " + " 'currentTimestamp' : '0x01', " + " 'previousHash' : '5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6' " + " }, " + " 'logs' : [ " + " ], " + " 'out' : '0x', " + " 'post' : { " + " '095e7baea6a6c7c4c2dfeb977efac326af552d87' : { " + " 'balance' : '0x0de0b6b3a76586a0', " + " 'code' : '0x606060405260e060020a600035046360fe47b1811460245780636d4ce63c14602e575b005b6004356000556022565b6000546060908152602090f3', " + " 'nonce' : '0x00', " + " 'storage' : { " + " '0x00' : '0x0400' " + " } " + " }, " + " '2adc25665018aa1fe0e6bc666dac8fc2697ff9ba' : { " + " 'balance' : '0x67c3', " + " 'code' : '0x', " + " 'nonce' : '0x00', " + " 'storage' : { " + " } " + " }, " + " 'a94f5374fce5edbc8e2a8697c15331677e6ebf0b' : { " + " 'balance' : '0x0DE0B6B3A762119D', " + " 'code' : '0x', " + " 'nonce' : '0x01', " + " 'storage' : { " + " } " + " } " + " }, " + " 'postStateRoot' : '17454a767e5f04461256f3812ffca930443c04a47d05ce3f38940c4a14b8c479', " + " 'pre' : { " + " '095e7baea6a6c7c4c2dfeb977efac326af552d87' : { " + " 'balance' : '0x0de0b6b3a7640000', " + " 'code' : '0x606060405260e060020a600035046360fe47b1811460245780636d4ce63c14602e575b005b6004356000556022565b6000546060908152602090f3', " + " 'nonce' : '0x00', " + " 'storage' : { " + " '0x00' : '0x02' " + " } " + " }, " + " 'a94f5374fce5edbc8e2a8697c15331677e6ebf0b' : { " + " 'balance' : '0x0de0b6b3a7640000', " + " 'code' : '0x', " + " 'nonce' : '0x00', " + " 'storage' : { " + " } " + " } " + " }, " + " 'transaction' : { " + " 'data' : '0x60fe47b10000000000000000000000000000000000000000000000000000000000000400', " + " 'gasLimit' : '0x061a80', " + " 'gasPrice' : '0x01', " + " 'nonce' : '0x00', " + " 'secretKey' : '45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8', " + " 'to' : '095e7baea6a6c7c4c2dfeb977efac326af552d87', " + " 'value' : '0x0186a0' " + " } " + " } " + "}"; StateTestSuite stateTestSuite = new StateTestSuite(json.replaceAll("'", "\"")); List<String> res = new StateTestRunner(stateTestSuite.getTestCases().get("test1")) { @Override protected ProgramResult executeTransaction(Transaction tx) { { Repository track = repository.startTracking(); Transaction txConst = CallTransaction.createCallTransaction(0, 0, 100000000000000L, "095e7baea6a6c7c4c2dfeb977efac326af552d87", 0, CallTransaction.Function.fromSignature("get")); txConst.sign(new ECKey()); Block bestBlock = block; TransactionExecutor executor = new TransactionExecutor (txConst, bestBlock.getCoinbase(), track, new BlockStoreDummy(), invokeFactory, bestBlock) .setLocalCall(true); executor.init(); executor.execute(); executor.go(); executor.finalization(); track.rollback(); logger.info("Return value: " + new IntType("uint").decode(executor.getResult().getHReturn())); } return super.executeTransaction(tx); } }.runImpl(); if (!res.isEmpty()) throw new RuntimeException("Test failed: " + res); }