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

Add fallback for available balance to be compatible with node version 6 #389

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

soerenbf
Copy link
Collaborator

@soerenbf soerenbf commented Sep 6, 2024

Changes

  • Add fallback for AccountInfo.accountAvailableBalance

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

const accountAmount = CcdAmount.fromProto(unwrap(acc.amount));

let accountAvailableBalance: CcdAmount.Type;
if (acc.availableBalance !== undefined) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:
It would be good to add a comment on why this can be undefined, since the current gRPC makes it looks like it cannot, so we should add this context.
It should include what node versions this will actually be relevant for

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, will add this

@soerenbf soerenbf merged commit d2e5a42 into release/web-sdk/8 Sep 6, 2024
3 checks passed
@soerenbf soerenbf deleted the node-6-compat branch September 6, 2024 10:39
@soerenbf soerenbf mentioned this pull request Sep 9, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants