@@ -47,47 +47,47 @@ public static String toByteCode(String binary) {
4747 return "0x" + binary ;
4848 }
4949
50- public CompletableFuture < EthBlockNumber > getBlockNumber () {
50+ public EthBlockNumber getBlockNumber () {
5151 EthBlockNumber result = new EthBlockNumber ();
5252 try {
5353 result = this .web3j .ethBlockNumber ().sendAsync ().get ();
5454 } catch (Exception ex ) {
5555 System .out .println (GENERIC_EXCEPTION );
5656 }
57- return CompletableFuture . completedFuture ( result ) ;
57+ return result ;
5858 }
5959
60- public CompletableFuture < EthAccounts > getEthAccounts () {
60+ public EthAccounts getEthAccounts () {
6161 EthAccounts result = new EthAccounts ();
6262 try {
6363 result = this .web3j .ethAccounts ().sendAsync ().get ();
6464 } catch (Exception ex ) {
6565 System .out .println (GENERIC_EXCEPTION );
6666 }
67- return CompletableFuture . completedFuture ( result ) ;
67+ return result ;
6868 }
6969
70- public CompletableFuture < EthGetTransactionCount > getTransactionCount () {
70+ public EthGetTransactionCount getTransactionCount () {
7171 EthGetTransactionCount result = new EthGetTransactionCount ();
7272 try {
7373 result = this .web3j .ethGetTransactionCount (DEFAULT_ADDRESS , DefaultBlockParameter .valueOf ("latest" )).sendAsync ().get ();
7474 } catch (Exception ex ) {
7575 System .out .println (GENERIC_EXCEPTION );
7676 }
77- return CompletableFuture . completedFuture ( result ) ;
77+ return result ;
7878 }
7979
80- public CompletableFuture < EthGetBalance > getEthBalance () {
80+ public EthGetBalance getEthBalance () {
8181 EthGetBalance result = new EthGetBalance ();
8282 try {
8383 result = this .web3j .ethGetBalance (DEFAULT_ADDRESS , DefaultBlockParameter .valueOf ("latest" )).sendAsync ().get ();
8484 } catch (Exception ex ) {
8585 System .out .println (GENERIC_EXCEPTION );
8686 }
87- return CompletableFuture . completedFuture ( result ) ;
87+ return result ;
8888 }
8989
90- public CompletableFuture < String > fromScratchContractExample () {
90+ public String fromScratchContractExample () {
9191
9292 String contractAddress = "" ;
9393
@@ -108,13 +108,13 @@ public CompletableFuture<String> fromScratchContractExample() {
108108
109109 } catch (Exception ex ) {
110110 System .out .println (PLEASE_SUPPLY_REAL_DATA );
111- return CompletableFuture . completedFuture ( PLEASE_SUPPLY_REAL_DATA ) ;
111+ return PLEASE_SUPPLY_REAL_DATA ;
112112 }
113- return CompletableFuture . completedFuture ( contractAddress ) ;
113+ return contractAddress ;
114114 }
115115
116116 @ Async
117- public CompletableFuture < String > sendTx () {
117+ public String sendTx () {
118118 String transactionHash = "" ;
119119
120120 try {
@@ -135,10 +135,10 @@ public CompletableFuture<String> sendTx() {
135135
136136 } catch (Exception ex ) {
137137 System .out .println (PLEASE_SUPPLY_REAL_DATA );
138- return CompletableFuture . completedFuture ( PLEASE_SUPPLY_REAL_DATA ) ;
138+ return PLEASE_SUPPLY_REAL_DATA ;
139139 }
140140
141- return CompletableFuture . completedFuture ( transactionHash ) ;
141+ return transactionHash ;
142142 }
143143}
144144
0 commit comments