Permalink
Browse files

Merge pull request #763 from web3j/release/4.0

Merge release/4.0 to master
  • Loading branch information...
snazha-blkio committed Oct 30, 2018
2 parents f8b044a + cf66e64 commit 6160282a5912ba1f35394312e6e783e040da4af3
Showing with 2,354 additions and 1,115 deletions.
  1. +29 −5 .gitlab-ci.yml
  2. +12 −12 README.rst
  3. +14 −12 build.gradle
  4. +2 −1 codegen/build.gradle
  5. +2 −2 codegen/src/main/java/org/web3j/codegen/FunctionWrapperGenerator.java
  6. +39 −25 codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java
  7. +101 −76 codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapperGenerator.java
  8. +2 −2 codegen/src/main/java/org/web3j/codegen/TruffleJsonFunctionWrapperGenerator.java
  9. +55 −19 codegen/src/test/java/org/web3j/codegen/SolidityFunctionWrapperGeneratorTest.java
  10. +5 −5 codegen/src/test/java/org/web3j/codegen/SolidityFunctionWrapperTest.java
  11. +1 −1 codegen/src/test/resources/solidity/arrays/build/Arrays.bin
  12. +2 −2 codegen/src/test/resources/solidity/build.sh
  13. +1 −1 codegen/src/test/resources/solidity/contracts/build/HumanStandardToken.bin
  14. +1 −1 codegen/src/test/resources/solidity/contracts/build/StandardToken.bin
  15. +1 −1 codegen/src/test/resources/solidity/fibonacci/build/Fibonacci.bin
  16. +1 −1 codegen/src/test/resources/solidity/greeter/build/Greeter.bin
  17. +1 −1 codegen/src/test/resources/solidity/greeter/build/Mortal.bin
  18. +1 −1 codegen/src/test/resources/solidity/shipit/build/ShipIt.bin
  19. +1 −1 codegen/src/test/resources/solidity/simplestorage/build/SimpleStorage.bin
  20. +4 −1 config/checkstyle/checkstyle.xml
  21. +3 −2 console/src/main/java/org/web3j/console/Runner.java
  22. +1 −1 core/build.gradle
  23. +4 −3 core/src/main/java/org/web3j/contracts/token/ERC20BasicInterface.java
  24. +3 −3 core/src/main/java/org/web3j/contracts/token/ERC20Interface.java
  25. +195 −131 core/src/main/java/org/web3j/ens/contracts/generated/ENS.java
  26. +322 −219 core/src/main/java/org/web3j/ens/contracts/generated/PublicResolver.java
  27. +2 −2 core/src/main/java/org/web3j/protocol/Service.java
  28. +5 −5 core/src/main/java/org/web3j/protocol/Web3jService.java
  29. +44 −44 core/src/main/java/org/web3j/protocol/core/JsonRpc2_0Web3j.java
  30. +5 −14 core/src/main/java/org/web3j/protocol/core/RemoteCall.java
  31. +5 −4 core/src/main/java/org/web3j/protocol/core/Request.java
  32. +18 −0 core/src/main/java/org/web3j/protocol/exceptions/TransactionException.java
  33. +38 −1 core/src/main/java/org/web3j/protocol/http/HttpService.java
  34. +4 −34 core/src/main/java/org/web3j/protocol/ipc/IpcService.java
  35. +66 −66 core/src/main/java/org/web3j/protocol/rx/JsonRpc2_0Rx.java
  36. +77 −75 core/src/main/java/org/web3j/protocol/rx/Web3jRx.java
  37. +8 −7 core/src/main/java/org/web3j/protocol/websocket/WebSocketService.java
  38. +1 −1 core/src/main/java/org/web3j/protocol/websocket/WebSocketSubscription.java
  39. +7 −0 core/src/main/java/org/web3j/tx/Contract.java
  40. +1 −1 core/src/main/java/org/web3j/tx/response/PollingTransactionReceiptProcessor.java
  41. +1 −1 core/src/main/java/org/web3j/tx/response/QueuingTransactionReceiptProcessor.java
  42. +18 −17 core/src/main/java/org/web3j/utils/{Observables.java → Flowables.java}
  43. +2 −2 core/src/main/resources/solidity/build.sh
  44. +1 −1 core/src/main/resources/solidity/ens/build/ENS.bin
  45. +1 −1 core/src/main/resources/solidity/ens/build/PublicResolver.bin
  46. +1 −1 core/src/test/java/org/web3j/protocol/core/JsonRpc2_0Web3jTest.java
  47. +1 −1 core/src/test/java/org/web3j/protocol/core/filters/BlockFilterTest.java
  48. +6 −6 core/src/test/java/org/web3j/protocol/core/filters/FilterTester.java
  49. +1 −1 core/src/test/java/org/web3j/protocol/core/filters/LogFilterTest.java
  50. +1 −1 core/src/test/java/org/web3j/protocol/core/filters/PendingTransactionFilterTest.java
  51. +0 −7 core/src/test/java/org/web3j/protocol/ipc/IpcServiceTest.java
  52. +157 −18 core/src/test/java/org/web3j/protocol/rx/JsonRpc2_0RxTest.java
  53. +33 −35 core/src/test/java/org/web3j/protocol/websocket/WebSocketServiceTest.java
  54. +16 −1 core/src/test/java/org/web3j/tx/ContractTest.java
  55. +4 −1 core/src/test/java/org/web3j/tx/response/PollingTransactionReceiptProcessorTest.java
  56. +17 −17 core/src/test/java/org/web3j/utils/{ObservablesTests.java → FlowablesTests.java}
  57. +173 −0 crypto/src/main/java/org/web3j/crypto/Bip32ECKeyPair.java
  58. +78 −0 crypto/src/main/java/org/web3j/crypto/Bip44WalletUtils.java
  59. +39 −49 crypto/src/main/java/org/web3j/crypto/MnemonicUtils.java
  60. +55 −7 crypto/src/main/java/org/web3j/crypto/Sign.java
  61. +75 −0 crypto/src/test/java/org/web3j/crypto/Base58.java
  62. +159 −0 crypto/src/test/java/org/web3j/crypto/Bip32Test.java
  63. +97 −0 crypto/src/test/java/org/web3j/crypto/Bip44WalletUtilsTest.java
  64. +16 −6 crypto/src/test/java/org/web3j/crypto/SignTest.java
  65. +85 −0 crypto/src/test/java/org/web3j/crypto/StaticMnemonicUtilsTest.java
  66. +1 −1 crypto/src/test/java/org/web3j/crypto/WalletUtilsTest.java
  67. +2 −2 docs/source/conf.py
  68. +2 −2 docs/source/development.rst
  69. +20 −20 docs/source/filters.rst
  70. +11 −11 docs/source/getting_started.rst
  71. +18 −6 docs/source/smart_contracts.rst
  72. +10 −9 geth/src/main/java/org/web3j/protocol/geth/Geth.java
  73. +3 −3 geth/src/main/java/org/web3j/protocol/geth/JsonRpc2_0Geth.java
  74. +1 −1 gradle.properties
  75. +2 −1 gradle/wrapper/gradle-wrapper.properties
  76. +2 −2 integration-tests/scripts/generateWrappers.sh
  77. +2 −2 integration-tests/src/test/java/org/web3j/generated/Arrays.java
  78. +8 −9 integration-tests/src/test/java/org/web3j/generated/Fibonacci.java
  79. +2 −2 integration-tests/src/test/java/org/web3j/generated/Greeter.java
  80. +13 −14 integration-tests/src/test/java/org/web3j/generated/HumanStandardToken.java
  81. +76 −43 integration-tests/src/test/java/org/web3j/generated/MetaCoin.java
  82. +2 −2 integration-tests/src/test/java/org/web3j/generated/ShipIt.java
  83. +2 −2 integration-tests/src/test/java/org/web3j/generated/SimpleStorage.java
  84. +27 −20 integration-tests/src/test/java/org/web3j/protocol/core/{ObservableIT.java → FlowableIT.java}
  85. +7 −7 integration-tests/src/test/java/org/web3j/protocol/scenarios/HumanStandardTokenGeneratedIT.java
  86. +22 −0 utils/src/main/java/org/web3j/crypto/Hash.java
View
@@ -1,6 +1,13 @@
image: gradle:alpine
variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
paths:
@@ -10,19 +17,36 @@ cache:
stages:
- build
- test
- deploy
build:
stage: build
script:
- gradle clean build
- gradle clean build -x test
unit tests:
stage: test
script:
- gradle test
# integration tests:
publish_snapshot:
stage: deploy
script:
- gradle uploadArchives
environment:
name: publish_snapshot
when: manual
only:
- /release/.*$/
publish_release:
stage: deploy
script:
- gradle uploadArchives
# stage: test
# script:
# - $ ./gradlew -Pintegration-tests=true :integration-tests:test
environment:
name: publish_release
when: manual
only:
- master
View
@@ -124,7 +124,7 @@ Java 8:
<dependency>
<groupId>org.web3j</groupId>
<artifactId>core</artifactId>
<version>3.5.0</version>
<version>4.0.0</version>
</dependency>
Android:
@@ -145,7 +145,7 @@ Java 8:
.. code-block:: groovy
compile ('org.web3j:core:3.5.0')
compile ('org.web3j:core:4.0.0')
Android:
@@ -203,12 +203,12 @@ To send asynchronous requests using a CompletableFuture (Future on Android):
Web3ClientVersion web3ClientVersion = web3.web3ClientVersion().sendAsync().get();
String clientVersion = web3ClientVersion.getWeb3ClientVersion();
To use an RxJava Observable:
To use an RxJava Flowable:
.. code-block:: java
Web3j web3 = Web3j.build(new HttpService()); // defaults to http://localhost:8545/
web3.web3ClientVersion().observable().subscribe(x -> {
web3.web3ClientVersion().flowable().subscribe(x -> {
String clientVersion = x.getWeb3ClientVersion();
...
});
@@ -257,7 +257,7 @@ Then generate the wrapper code using web3j's `Command line tools`_:
.. code-block:: bash
web3j solidity generate /path/to/<smart-contract>.bin /path/to/<smart-contract>.abi -o /path/to/src/main/java -p com.your.organisation.name
web3j solidity generate -b /path/to/<smart-contract>.bin -a /path/to/<smart-contract>.abi -o /path/to/src/main/java -p com.your.organisation.name
Now you can create and deploy your smart contract:
@@ -330,15 +330,15 @@ To receive all new blocks as they are added to the blockchain:
.. code-block:: java
Subscription subscription = web3j.blockObservable(false).subscribe(block -> {
Subscription subscription = web3j.blockFlowable(false).subscribe(block -> {
...
});
To receive all new transactions as they are added to the blockchain:
.. code-block:: java
Subscription subscription = web3j.transactionObservable().subscribe(tx -> {
Subscription subscription = web3j.transactionFlowable().subscribe(tx -> {
...
});
@@ -347,21 +347,21 @@ been grouped into a block together):
.. code-block:: java
Subscription subscription = web3j.pendingTransactionObservable().subscribe(tx -> {
Subscription subscription = web3j.pendingTransactionFlowable().subscribe(tx -> {
...
});
Or, if you'd rather replay all blocks to the most current, and be notified of new subsequent
blocks being created:
.. code-block:: java
Subscription subscription = catchUpToLatestAndSubscribeToNewBlocksObservable(
Subscription subscription = replayPastAndFutureBlocksFlowable(
<startBlockNumber>, <fullTxObjects>)
.subscribe(block -> {
...
});
There are a number of other transaction and block replay Observables described in the
There are a number of other transaction and block replay Flowables described in the
`docs <http://docs.web3j.io/filters.html>`_.
Topic filters are also supported:
@@ -371,7 +371,7 @@ Topic filters are also supported:
EthFilter filter = new EthFilter(DefaultBlockParameterName.EARLIEST,
DefaultBlockParameterName.LATEST, <contract-address>)
.addSingleTopic(...)|.addOptionalTopics(..., ...)|...;
web3j.ethLogObservable(filter).subscribe(log -> {
web3j.ethLogFlowable(filter).subscribe(log -> {
...
});
@@ -576,7 +576,7 @@ To run the integration tests:
Snapshot Dependencies
---------------------
Snapshot versions of web3j follow the ``<major>.<minor>.<build>-SNAPSHOT`` convention, for example: 3.6.0-SNAPSHOT.
Snapshot versions of web3j follow the ``<major>.<minor>.<build>-SNAPSHOT`` convention, for example: 4.0.0-SNAPSHOT.
| If you would like to use snapshots instead please add a new maven repository pointing to:
View
@@ -4,9 +4,10 @@ buildscript {
ext.javapoetVersion = '1.7.0'
ext.jnr_unixsocketVersion = '0.15'
ext.okhttpVersion = '3.8.1'
ext.rxjavaVersion = '1.2.4'
ext.rxjavaVersion = '2.2.2'
ext.slf4jVersion = '1.7.25'
ext.javaWebSocketVersion = '1.3.8'
ext.picocliVersion = '3.0.0'
// test dependencies
ext.equalsverifierVersion = '2.1.7'
@@ -27,7 +28,9 @@ buildscript {
plugins {
id "com.jfrog.bintray" version "1.7.3"
id "net.researchgate.release" version "2.7.0"
id "org.ajoberstar.grgit" version "3.0.0-rc.2"
// TODO: sort out the tagging
// id "net.researchgate.release" version "2.7.0"
}
apply plugin: 'java'
@@ -122,8 +125,9 @@ configure(subprojects.findAll { it.name != 'integration-tests' }) {
}
ext {
ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : System.getenv('OSSRH_USERNAME')
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : System.getenv('OSSRH_PASSWORD')
ossrhRepoUrl = project.hasProperty('ossrhRepoUrl') ? project.property('ossrhRepoUrl') : System.getenv('OSSRH_REPO_URL')
bintrayUser = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
bintrayKey = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
isSnapshotVersion = project.version.endsWith("-SNAPSHOT")
@@ -151,11 +155,10 @@ configure(subprojects.findAll { it.name != 'integration-tests' }) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
onlyIf {
ossrhUsername != '' && ossrhPassword != ''
ossrhUsername != '' && ossrhPassword != '' && ossrhRepoUrl != ''
}
String repoUrl = isSnapshotVersion ? "http://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
repository(url: repoUrl) {
repository(url: ossrhRepoUrl) {
authentication(
userName: ossrhUsername,
password: ossrhPassword
@@ -228,11 +231,10 @@ configure(subprojects.findAll { it.name != 'integration-tests' }) {
}
}
release {
tagTemplate = 'v${version}'
failOnCommitNeeded = true
}
//release {
// tagTemplate = 'v${version}'
// failOnCommitNeeded = true
//}
task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = subprojects.test
View
@@ -3,6 +3,7 @@ description 'web3j project code generators'
dependencies {
compile project(':core'),
"com.squareup:javapoet:$javapoetVersion"
"com.squareup:javapoet:$javapoetVersion",
"info.picocli:picocli:$picocliVersion"
testCompile project(path: ':core', configuration: 'testArtifacts')
}
@@ -17,11 +17,11 @@
final boolean useJavaNativeTypes;
FunctionWrapperGenerator(
String destinationDirLocation,
File destinationDirLocation,
String basePackageName,
boolean useJavaNativeTypes) {
this.destinationDirLocation = new File(destinationDirLocation);
this.destinationDirLocation = destinationDirLocation;
this.basePackageName = basePackageName;
this.useJavaNativeTypes = useJavaNativeTypes;
}
Oops, something went wrong.

0 comments on commit 6160282

Please sign in to comment.