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

Fixes ledger version in getTrustlines #1505

Merged
merged 4 commits into from
Aug 6, 2021
Merged

Fixes ledger version in getTrustlines #1505

merged 4 commits into from
Aug 6, 2021

Conversation

mvadari
Copy link
Collaborator

@mvadari mvadari commented Aug 4, 2021

High Level Overview of Change

getTrustlines wasn't using ledgerVersion in the options at all, and was instead getting the current ledger version. This PR fixes that.

Context of Change

Fixes #1501

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Before / After

Test Plan

Added a test to check for the correct behavior. CI passes.

Sorry, something went wrong.

@@ -31,7 +31,7 @@ async function getTrustlines(
// 2. Make Request
const responses = await this._requestAll('account_lines', {
account: address,
ledger_index: await this.getLedgerVersion(),
ledger_index: options.ledgerVersion,
Copy link
Contributor

@natenichols natenichols Aug 4, 2021

Choose a reason for hiding this comment

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

I think we still want to default to this.getLedgerVersion() when no options is provided.

Can we do something like

let ledger_index = options.ledgerVersion

if (ledger_index === undefined)
     ledger_index = await this.getLedgerVersion()

const responses = await this._requestAll('account_lines', {
    ........
    ledger_index,
    ........
}

@mvadari mvadari requested a review from natenichols August 4, 2021 22:50
Copy link
Contributor

@natenichols natenichols left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Collaborator

@intelliot intelliot left a comment

Choose a reason for hiding this comment

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

LGTM

@natenichols natenichols merged commit b81c1da into develop Aug 6, 2021
@natenichols natenichols deleted the mv/1501 branch August 6, 2021 17:18
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.

Relations between transactions and balances
3 participants