@Test public void testEtherTransactionAsRlpValues() { SignatureData signatureData = new SignatureData((byte) 0, new byte[32], new byte[32]); List<RlpType> rlpStrings = createEtherTransaction().asRlpValues(signatureData); assertThat(rlpStrings.size(), is(6)); assertThat(rlpStrings.get(3), IsEqual.<RlpType>equalTo(RlpString.create(new BigInteger("add5355", 16)))); }
List<RlpType> asRlpValues(SignatureData signatureData) { List<RlpType> result = new ArrayList<>(); result.add(RlpString.create(getNonce())); result.add(RlpString.create(getGasPrice())); result.add(RlpString.create(getGasLimit())); String to = getTo(); if (to != null && to.length() > 0) { result.add(RlpString.create(NumericUtil.hexToBytes(to))); } else { result.add(RlpString.create("")); } result.add(RlpString.create(getValue())); byte[] data = NumericUtil.hexToBytes(getData()); result.add(RlpString.create(data)); if (signatureData != null && signatureData.getV() > 0) { result.add(RlpString.create(signatureData.getV())); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getR()))); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getS()))); } return result; }
EthereumTransaction implements TransactionSigner { List<RlpType> asRlpValues(SignatureData signatureData) { List<RlpType> result = new ArrayList<>(); result.add(RlpString.create(getNonce())); result.add(RlpString.create(getGasPrice())); result.add(RlpString.create(getGasLimit())); String to = getTo(); if (to != null && to.length() > 0) { result.add(RlpString.create(NumericUtil.hexToBytes(to))); } else { result.add(RlpString.create("")); } result.add(RlpString.create(getValue())); byte[] data = NumericUtil.hexToBytes(getData()); result.add(RlpString.create(data)); if (signatureData != null && signatureData.getV() > 0) { result.add(RlpString.create(signatureData.getV())); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getR()))); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getS()))); } return result; } }
EthereumTransaction implements TransactionSigner { List<RlpType> asRlpValues(SignatureData signatureData) { List<RlpType> result = new ArrayList<>(); result.add(RlpString.create(getNonce())); result.add(RlpString.create(getGasPrice())); result.add(RlpString.create(getGasLimit())); String to = getTo(); if (to != null && to.length() > 0) { result.add(RlpString.create(NumericUtil.hexToBytes(to))); } else { result.add(RlpString.create("")); } result.add(RlpString.create(getValue())); byte[] data = NumericUtil.hexToBytes(getData()); result.add(RlpString.create(data)); if (signatureData != null && signatureData.getV() > 0) { result.add(RlpString.create(signatureData.getV())); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getR()))); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getS()))); } return result; } EthereumTransaction(BigInteger nonce, BigInteger gasPrice, BigInteger gasLimit, String to,
                             BigInteger value, String data); }
EthereumTransaction implements TransactionSigner { List<RlpType> asRlpValues(SignatureData signatureData) { List<RlpType> result = new ArrayList<>(); result.add(RlpString.create(getNonce())); result.add(RlpString.create(getGasPrice())); result.add(RlpString.create(getGasLimit())); String to = getTo(); if (to != null && to.length() > 0) { result.add(RlpString.create(NumericUtil.hexToBytes(to))); } else { result.add(RlpString.create("")); } result.add(RlpString.create(getValue())); byte[] data = NumericUtil.hexToBytes(getData()); result.add(RlpString.create(data)); if (signatureData != null && signatureData.getV() > 0) { result.add(RlpString.create(signatureData.getV())); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getR()))); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getS()))); } return result; } EthereumTransaction(BigInteger nonce, BigInteger gasPrice, BigInteger gasLimit, String to,
                             BigInteger value, String data); BigInteger getNonce(); BigInteger getGasPrice(); BigInteger getGasLimit(); String getTo(); BigInteger getValue(); String getData(); @Override TxSignResult signTransaction(String chainID, String password, Wallet wallet); }
EthereumTransaction implements TransactionSigner { List<RlpType> asRlpValues(SignatureData signatureData) { List<RlpType> result = new ArrayList<>(); result.add(RlpString.create(getNonce())); result.add(RlpString.create(getGasPrice())); result.add(RlpString.create(getGasLimit())); String to = getTo(); if (to != null && to.length() > 0) { result.add(RlpString.create(NumericUtil.hexToBytes(to))); } else { result.add(RlpString.create("")); } result.add(RlpString.create(getValue())); byte[] data = NumericUtil.hexToBytes(getData()); result.add(RlpString.create(data)); if (signatureData != null && signatureData.getV() > 0) { result.add(RlpString.create(signatureData.getV())); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getR()))); result.add(RlpString.create(ByteUtil.trimLeadingZeroes(signatureData.getS()))); } return result; } EthereumTransaction(BigInteger nonce, BigInteger gasPrice, BigInteger gasLimit, String to,
                             BigInteger value, String data); BigInteger getNonce(); BigInteger getGasPrice(); BigInteger getGasLimit(); String getTo(); BigInteger getValue(); String getData(); @Override TxSignResult signTransaction(String chainID, String password, Wallet wallet);  }