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

TransactionResponse fail to serialize to json, because private seed is null #153

Open
cyberluke opened this issue Nov 14, 2018 · 0 comments
Open
Milestone

Comments

@cyberluke
Copy link

@cyberluke cyberluke commented Nov 14, 2018

Problem is here: https://github.com/stellar/java-stellar-sdk/blob/master/src/main/java/org/stellar/sdk/responses/TransactionResponse.java

Problem is:

  @SerializedName("source_account")
  private final KeyPair sourceAccount;

When it want to serialize KeyPair, it scream with exception about secretSeed cannot be serialized and converted into JSON.

This problem is in all responses with source_account property. Therefore currently I have to duplicate all these classes by hand, remove source_account property.

And every response it needs to iterate over all objects and transform them by hand just because of this:

for (TransactionResponse transactionResponse : transactionResponsePage.getRecords()) {
                GetTransaction transaction = new GetTransaction();
                transaction.setCreated(transactionResponse.getCreatedAt());
                transaction.setFee(transactionResponse.getFeePaid());
                transaction.setTxHash(transactionResponse.getHash());
                transactions.add(transaction);
}

Why GSON? Why don't you use Jackson.

@nullstyle nullstyle modified the milestones: v0.7.0, vNext Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.