diff --git a/README.md b/README.md index 37e13282e..87e1c8c02 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Add the following dependency to your project: org.web3j core - 0.1.2 + 0.1.3 ``` @@ -43,7 +43,7 @@ Add the following dependency to your project: repositories { maven {url "http://dl.bintray.com/web3j/maven"} } -compile ("org.web3j:core:0.1.2") +compile ("org.web3j:core:0.1.3") ``` Start up an Ethereum client if you don't already have one running, such as [Geth](https://github.com/ethereum/go-ethereum/wiki/geth): diff --git a/build.gradle b/build.gradle index 379f0e95b..c65f0a1f3 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'jacoco' apply plugin: 'maven-publish' group 'org.web3j' -version '0.1.2' +version '0.1.3' sourceCompatibility = 1.8 diff --git a/src/integration-test/java/org/web3j/protocol/jsonrpc20/ProtocolIT.java b/src/integration-test/java/org/web3j/protocol/jsonrpc20/ProtocolIT.java index 256ad73a2..f308b9259 100644 --- a/src/integration-test/java/org/web3j/protocol/jsonrpc20/ProtocolIT.java +++ b/src/integration-test/java/org/web3j/protocol/jsonrpc20/ProtocolIT.java @@ -217,7 +217,7 @@ public void testEthCall() throws Exception { public void testEthEstimateGas() throws Exception { EthEstimateGas ethEstimateGas = web3j.ethEstimateGas(config.ethCall()) .send(); - assertThat(ethEstimateGas.getAmountUsed(), equalTo(BigInteger.valueOf(50000000))); + assertTrue(ethEstimateGas.getAmountUsed().signum() == 1); } @Test diff --git a/src/main/java/org/web3j/methods/request/EthCall.java b/src/main/java/org/web3j/methods/request/EthCall.java index 8cec19eb8..7a118913c 100644 --- a/src/main/java/org/web3j/methods/request/EthCall.java +++ b/src/main/java/org/web3j/methods/request/EthCall.java @@ -11,35 +11,35 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) public class EthCall { - private String fromAddress; - private String toAddress; + private String from; + private String to; private BigInteger gas; private BigInteger gasPrice; private BigInteger value; private String data; - public EthCall(String toAddress, String data) { - this.toAddress = toAddress; + public EthCall(String to, String data) { + this.to = to; this.data = data; } - public EthCall(String fromAddress, String toAddress, + public EthCall(String from, String to, BigInteger gas, BigInteger gasPrice, BigInteger value, String data) { - this.fromAddress = fromAddress; - this.toAddress = toAddress; + this.from = from; + this.to = to; this.gas = gas; this.gasPrice = gasPrice; this.value = value; this.data = data; } - public String getFromAddress() { - return fromAddress; + public String getFrom() { + return from; } - public String getToAddress() { - return toAddress; + public String getTo() { + return to; } public String getGas() { diff --git a/src/main/java/org/web3j/methods/request/EthSendTransaction.java b/src/main/java/org/web3j/methods/request/EthSendTransaction.java index afb3dd634..9ec2fd33e 100644 --- a/src/main/java/org/web3j/methods/request/EthSendTransaction.java +++ b/src/main/java/org/web3j/methods/request/EthSendTransaction.java @@ -11,24 +11,24 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) public class EthSendTransaction { - private String fromAddress; - private String toAddress; + private String from; + private String to; private BigInteger gas; private BigInteger gasPrice; private BigInteger value; private String data; private BigInteger nonce; - public EthSendTransaction(String fromAddress, String data) { - this.fromAddress = fromAddress; + public EthSendTransaction(String from, String data) { + this.from = from; this.data = data; } - public EthSendTransaction(String fromAddress, String toAddress, + public EthSendTransaction(String from, String to, BigInteger gas, BigInteger gasPrice, BigInteger value, String data, BigInteger nonce) { - this.fromAddress = fromAddress; - this.toAddress = toAddress; + this.from = from; + this.to = to; this.gas = gas; this.gasPrice = gasPrice; this.value = value; @@ -36,12 +36,12 @@ public EthSendTransaction(String fromAddress, String toAddress, this.nonce = nonce; } - public String getFromAddress() { - return fromAddress; + public String getFrom() { + return from; } - public String getToAddress() { - return toAddress; + public String getTo() { + return to; } public String getGas() { diff --git a/src/main/java/org/web3j/methods/response/EthBlock.java b/src/main/java/org/web3j/methods/response/EthBlock.java index e8427071b..c485c47af 100644 --- a/src/main/java/org/web3j/methods/response/EthBlock.java +++ b/src/main/java/org/web3j/methods/response/EthBlock.java @@ -359,8 +359,11 @@ public static class TransactionObject extends Transaction implements Transaction public TransactionObject() { } - public TransactionObject(String hash, String nonce, String blockHash, String blockNumber, String transactionIndex, String fromAddress, String toAddress, String value, String gasPrice, String gas, String input) { - super(hash, nonce, blockHash, blockNumber, transactionIndex, fromAddress, toAddress, value, gasPrice, gas, input); + public TransactionObject(String hash, String nonce, String blockHash, String blockNumber, + String transactionIndex, String from, String to, String value, + String gasPrice, String gas, String input) { + super(hash, nonce, blockHash, blockNumber, transactionIndex, from, to, value, + gasPrice, gas, input); } @Override diff --git a/src/test/java/org/web3j/protocol/jsonrpc20/RequestTest.java b/src/test/java/org/web3j/protocol/jsonrpc20/RequestTest.java index ca9a2d925..3173ecb81 100644 --- a/src/test/java/org/web3j/protocol/jsonrpc20/RequestTest.java +++ b/src/test/java/org/web3j/protocol/jsonrpc20/RequestTest.java @@ -41,7 +41,7 @@ public void testEthCall() throws Exception { web3j.ethCall(new EthCall("0x52b93c80364dc2dd4444c146d73b9836bbbb2b3f", "0x0"), DefaultBlockParameter.valueOf("latest")).send(); - verifyResult("{\"jsonRpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"toAddress\":\"0x52b93c80364dc2dd4444c146d73b9836bbbb2b3f\",\"data\":\"0x0\"},\"latest\"],\"id\":1}"); + verifyResult("{\"jsonRpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"to\":\"0x52b93c80364dc2dd4444c146d73b9836bbbb2b3f\",\"data\":\"0x0\"},\"latest\"],\"id\":1}"); } private void verifyResult(String expected) throws Exception {