Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Chain.Transaction There is no TXID in this class ? #10

Open
tianmuwu opened this issue Jan 19, 2021 · 3 comments
Open

Chain.Transaction There is no TXID in this class ? #10

tianmuwu opened this issue Jan 19, 2021 · 3 comments
Labels
question Further information is requested

Comments

@tianmuwu
Copy link

Chain.Transaction There is no TXID in this class ?

@Starsakary
Copy link
Collaborator

No there is not. The same as what's in java-tron, transaction id is in TransactionInfo.

@Starsakary Starsakary added the question Further information is requested label Feb 23, 2021
@hedayatiR
Copy link

you can calculate txHash with method below. Input is signedTX.

private String getTxHash(Chain.Transaction tx) {
SHA256.Digest digest = new SHA256.Digest();
digest.update(tx.getRawData().toByteArray());
byte[] txid = digest.digest();
return TronClient.toHex(txid);
}

@Starsakary
Copy link
Collaborator

Starsakary commented Mar 3, 2021

In the next version, we're planning to return directly the transaction hash if the transaction has been successfully broadcasted.

Please note that a successful broadcast is not equivalent to a successful transaction, you can only use getTransactionInfoById to check this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants