Echo back txn hash

pull/2/head
Marat Subkhankulov 7 years ago
parent 68b49286a1
commit 003033e34c
  1. 4
      app/src/main/java/com/wallet/crypto/trustapp/controller/Controller.java

@ -719,6 +719,7 @@ public class Controller {
}
protected Void doInBackground(Void... params) {
String txnHash = "";
try {
Web3j web3j = Web3jFactory.build(new InfuraHttpService(mCurrentNetwork.getRpcUrl()));
@ -762,12 +763,13 @@ public class Controller {
Log.d(TAG, "Transaction JSON-RPC"+ raw.getJsonrpc());
Log.d(TAG, "Transaction result: " + raw.getResult());
Log.d(TAG, "Transaction hash: " + raw.getTransactionHash());
txnHash = raw.getTransactionHash();
} catch (Exception e) {
Log.e(TAG, e.toString());
listener.onTaskCompleted(new TaskResult(TaskStatus.FAILURE, "Transaction error: " + e.toString()));
return null;
}
listener.onTaskCompleted(new TaskResult(TaskStatus.SUCCESS, "Payment sent"));
listener.onTaskCompleted(new TaskResult(TaskStatus.SUCCESS, "Payment sent: " + txnHash));
return null;
}
}

Loading…
Cancel
Save