-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Added support for transactions and event processing in generated s…
…mart contract code. 2. Pulled TransactionReceipt into it's own class. 3. Removed parameterized type from Event implementation. 4. Bumped version.
- Loading branch information
Showing
36 changed files
with
1,309 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Filters | ||
======= | ||
|
||
Please refer to `EventFilterIT <https://github.com/web3j/web3j/blob/master/src/integration-test/java/org/web3j/protocol/scenarios/EventFilterIT.java>`_ for an example of how to do this until this section is written. | ||
Please refer to `EventFilterIT <https://github.com/web3j/web3j/blob/master/src/integration-test/java/org/web3j/protocol/scenarios/EventFilterIT.java>`_ | ||
for an example of how to do this until this section is written. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 17 additions & 18 deletions
35
src/integration-test/java/org/web3j/generated/Arrays.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
package org.web3j.generated; | ||
|
||
import java.lang.InterruptedException; | ||
import java.lang.String; | ||
import java.util.concurrent.ExecutionException; | ||
import java.util.Collections; | ||
import java.util.concurrent.Future; | ||
import org.web3j.abi.Contract; | ||
import org.web3j.abi.TypeReference; | ||
import org.web3j.abi.datatypes.DynamicArray; | ||
import org.web3j.abi.datatypes.Function; | ||
import org.web3j.abi.datatypes.StaticArray; | ||
import org.web3j.abi.datatypes.generated.Uint256; | ||
import org.web3j.crypto.Credentials; | ||
import org.web3j.protocol.Web3j; | ||
import org.web3j.protocol.core.methods.response.TransactionReceipt; | ||
|
||
/** | ||
* <p>Auto generated code.<br> | ||
* <strong>Do not modifiy!</strong><br> | ||
* Please use {@link org.web3j.codegen.SolidityFunctionWrapperGenerator} to update.</p> | ||
*/ | ||
public final class Arrays extends Contract { | ||
public Arrays(String contractAddress, Web3j web3j) { | ||
super(contractAddress, web3j); | ||
} | ||
private static final String BINARY = "60606040526101f5806100126000396000f3606060405260e060020a6000350463b96f54d18114610029578063beda363b146100bc575b610002565b34610002576040805161014081810190925261018191600491610144918390600a90839083908082843750909550505050505061014060405190810160405280600a905b600081526020019060019003908161006d5750600a905060005b818110156101ee5783816001018303600a8110156100025760200201518382600a811015610002576020020152600101610087565b3461000257604080516020600480358082013583810280860185019096528085526101a49592946024949093928501928291850190849080828437509496505050505050506040805160208101825260008082528351925191929182908059106101235750595b90808252806020026020018201604052801561013a575b509250600090505b818110156101ee578381600101830381518110156100025790602001906020020151838281518110156100025760209081029091010152600101610142565b60405180826101408083818460006004602df15090500191505060405180910390f35b60405180806020018281038252838181518152602001915080519060200190602002808383829060006004602084601f0104600302600f01f1509050019250505060405180910390f35b505091905056"; | ||
|
||
public StaticArray<Uint256> fixedReverse(StaticArray<Uint256> input) throws InterruptedException, ExecutionException { | ||
Function function = new Function<>("fixedReverse", | ||
java.util.Arrays.asList(input), | ||
java.util.Arrays.asList(new TypeReference<StaticArray<Uint256>>() {})); | ||
return executeSingleValueReturn(function); | ||
} | ||
public Arrays(String contractAddress, Web3j web3j, Credentials credentials) { | ||
super(contractAddress, web3j, credentials); | ||
} | ||
|
||
public DynamicArray<Uint256> dynamicReverse(DynamicArray<Uint256> input) throws InterruptedException, ExecutionException { | ||
Function function = new Function<>("dynamicReverse", | ||
java.util.Arrays.asList(input), | ||
java.util.Arrays.asList(new TypeReference<DynamicArray<Uint256>>() {})); | ||
return executeSingleValueReturn(function); | ||
} | ||
public Future<TransactionReceipt> fixedReverse(StaticArray<Uint256> input) { | ||
Function function = new Function<>("fixedReverse", java.util.Arrays.asList(input), Collections.emptyList()); | ||
return executeTransactionAsync(function); | ||
} | ||
|
||
public Future<TransactionReceipt> dynamicReverse(DynamicArray<Uint256> input) { | ||
Function function = new Function<>("dynamicReverse", java.util.Arrays.asList(input), Collections.emptyList()); | ||
return executeTransactionAsync(function); | ||
} | ||
} |
45 changes: 28 additions & 17 deletions
45
src/integration-test/java/org/web3j/generated/Fibonacci.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,47 @@ | ||
package org.web3j.generated; | ||
|
||
import java.lang.InterruptedException; | ||
import java.lang.String; | ||
import java.util.Arrays; | ||
import java.util.concurrent.ExecutionException; | ||
import java.util.Collections; | ||
import java.util.concurrent.Future; | ||
import org.web3j.abi.Contract; | ||
import org.web3j.abi.EventValues; | ||
import org.web3j.abi.TypeReference; | ||
import org.web3j.abi.datatypes.Event; | ||
import org.web3j.abi.datatypes.Function; | ||
import org.web3j.abi.datatypes.generated.Uint256; | ||
import org.web3j.crypto.Credentials; | ||
import org.web3j.protocol.Web3j; | ||
import org.web3j.protocol.core.methods.response.TransactionReceipt; | ||
|
||
/** | ||
* <p>Auto generated code.<br> | ||
* <strong>Do not modifiy!</strong><br> | ||
* Please use {@link org.web3j.codegen.SolidityFunctionWrapperGenerator} to update.</p> | ||
*/ | ||
public final class Fibonacci extends Contract { | ||
public Fibonacci(String contractAddress, Web3j web3j) { | ||
super(contractAddress, web3j); | ||
} | ||
private static final String BINARY = "606060405260d18060106000396000f3606060405260e060020a60003504633c7fdc708114602657806361047ff4146044575b6002565b34600257605160043560006063825b600081151560a75750600060a2565b3460025760516004356035565b60408051918252519081900360200190f35b604080518481526020810183905281519293507f71e71a8458267085d5ab16980fd5f114d2d37f232479c245d523ce8d23ca40ed929081900390910190a15b919050565b816001141560b65750600160a2565b60c0600283036035565b60ca600184036035565b01905060a256"; | ||
|
||
public Uint256 fibonacciNotify(Uint256 number) throws InterruptedException, ExecutionException { | ||
Function function = new Function<>("fibonacciNotify", | ||
Arrays.asList(number), | ||
Arrays.asList(new TypeReference<Uint256>() {})); | ||
return executeSingleValueReturn(function); | ||
} | ||
public Fibonacci(String contractAddress, Web3j web3j, Credentials credentials) { | ||
super(contractAddress, web3j, credentials); | ||
} | ||
|
||
public Uint256 fibonacci(Uint256 number) throws InterruptedException, ExecutionException { | ||
Function function = new Function<>("fibonacci", | ||
Arrays.asList(number), | ||
Arrays.asList(new TypeReference<Uint256>() {})); | ||
return executeSingleValueReturn(function); | ||
} | ||
public Future<TransactionReceipt> fibonacciNotify(Uint256 number) { | ||
Function function = new Function<>("fibonacciNotify", Arrays.asList(number), Collections.emptyList()); | ||
return executeTransactionAsync(function); | ||
} | ||
|
||
public Future<Uint256> fibonacci(Uint256 number) { | ||
Function function = new Function<>("fibonacci", | ||
Arrays.asList(number), | ||
Arrays.asList(new TypeReference<Uint256>() {})); | ||
return executeCallSingleValueReturnAsync(function); | ||
} | ||
|
||
public EventValues processNotifyEvent(TransactionReceipt transactionReceipt) { | ||
Event event = new Event("Notify", | ||
Arrays.asList(), | ||
Arrays.asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {})); | ||
return extractEventParameters(event, transactionReceipt); | ||
} | ||
} |
Oops, something went wrong.