Skip to content

Commit

Permalink
1. Replaced fromAddress/toAddress with to/from in a couple of message…
Browse files Browse the repository at this point in the history
… method instances.

2. Updated testEthEstimateGas assertion.
3. Bumped version.
  • Loading branch information
conor10 committed Sep 16, 2016
1 parent cc0f572 commit 26a4110
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 29 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -33,7 +33,7 @@ Add the following dependency to your project:
<dependency>
<groupId>org.web3j</groupId>
<artifactId>core</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>
</dependency>
```

Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -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

Expand Down
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/web3j/methods/request/EthCall.java
Expand Up @@ -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() {
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/web3j/methods/request/EthSendTransaction.java
Expand Up @@ -11,37 +11,37 @@
*/
@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;
this.data = data;
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() {
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/org/web3j/methods/response/EthBlock.java
Expand Up @@ -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
Expand Down
Expand Up @@ -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 {
Expand Down

0 comments on commit 26a4110

Please sign in to comment.