Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not get transaction from transaction response #284

Closed
wumingmo opened this issue Jun 3, 2020 · 1 comment
Closed

can not get transaction from transaction response #284

wumingmo opened this issue Jun 3, 2020 · 1 comment
Labels

Comments

@wumingmo
Copy link

wumingmo commented Jun 3, 2020

What version are you using?

0.6.0

What did you do?

public Transaction getTransaction(TransactionResponse transactionResponse)
{
byte[] bytes = Base64.getDecoder().decode(transactionResponse.getEnvelopeXdr());
TransactionEnvelope transactionEnvelope = TransactionEnvelope.decode(new XdrDataInputStream(new ByteArrayInputStream(bytes)));
return transactionEnvelope.getTx();
}

The above piece of code (using version 0.6.0) is used to get a transaction from a TransactionResponse. It has been working fine at least before May 1st. But now it always gave the error "java.lang.RuntimeException: Unknown enum value: 2" at TransactionEnvelope.decode. I have tested the return result from transactionResponse.getEnvelopeXdr() on stellar lab, and it can get the transaction there. I am wondering whether this is due to some latest version update.

Thanks

What did you expect to see?

What did you see instead?

@wumingmo wumingmo added the bug label Jun 3, 2020
@abuiles
Copy link
Contributor

abuiles commented Jun 3, 2020

@wumingmo you need to upgrade to the latest version of this library. This problem occurs because you are trying to read a transaction envelope from protocol 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants