Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

DP-370 Fix history#93

Merged
Ronserruya merged 2 commits intov2-masterfrom
fix_history
Aug 27, 2019
Merged

DP-370 Fix history#93
Ronserruya merged 2 commits intov2-masterfrom
fix_history

Conversation

@Ronserruya
Copy link
Contributor

Fixed paging with txs history, before the fix the "get_tx_history" method returned None if it had to use paging.

Also changed the implementation from recursion to loop

pass
else:
current_loop_txs.append(raw_tx)
cursor = transaction['paging_token']
Copy link

Choose a reason for hiding this comment

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

I don't see a use for cursor, guess it's a leftover

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used for the next request, line 220

simple_tx = SimplifiedTransaction(raw_tx)
current_loop_txs.append(simple_tx)
except KinErrors.CantSimplifyError:
pass
Copy link

@katzio katzio Aug 21, 2019

Choose a reason for hiding this comment

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

hm, why not append it as is (like you did in the else section)?
and log the error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's just the way the method works, if you only want simple txs it skips everything else

@yosriz
Copy link

yosriz commented Aug 26, 2019

@Ronserruya can you add tests for the fix? i.e a scenario with paging?

@Ronserruya
Copy link
Contributor Author

@Ronserruya can you add tests for the fix? i.e a scenario with paging?

There is already a test for paging

@Ronserruya Ronserruya merged commit 8f9e30c into v2-master Aug 27, 2019
@Ronserruya Ronserruya deleted the fix_history branch August 27, 2019 06:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants