Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Snapshot proof commands #244

Closed
wants to merge 1 commit into from
Closed

Snapshot proof commands #244

wants to merge 1 commit into from

Conversation

pdecol
Copy link
Contributor

@pdecol pdecol commented Oct 10, 2019

resolves #217, resolves #175, resolves #46

This PR makes getNewAddresses, getInputs, getTransfers and getAccountData snapshot proof. It also follows the behaviour of the Javascript library more closely but it is not exactly the same. There is a difference in how these commands behave on addresses with balances and without transactions. I opened a ticket in the JavaScript GitHub repository where I documented the behaviour of the JavaScript library on such addresses (iotaledger/iota.js#427). As I stated in this ticket I think that the behaviour of the JavaScript library is in these cases a bit strange and I think that my suggestion that I also implemented in this PR is more logical. There has been no response so far but maybe @lzpap could help to coordinate how the commands should behave for addresses with balance and without transactions?

@lzpap
Copy link
Member

lzpap commented Oct 10, 2019

hey @pdecol, awesome! I'm on it ;)
However, bear in mind that this might be low priority for the other libs that already have account module, which solves the after snapshot issue by making the lib (locally) stateful.

Copy link
Contributor

@todofixthis todofixthis left a comment

Choose a reason for hiding this comment

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

Gave it a quick glance last night; will give it a proper look-over today.


If you are familiar with Python 2's C API, we'd love to hear from you!
Check the `GitHub issue <https://github.com/todofixthis/pyota-ccurl/issues/4>`_
for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

🙀 Wow, good catch!

break

# Reset the command so that we can call it again.
wasp_response = wasf_command(addresses=[addy])
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
wasp_response = wasf_command(addresses=[addy])
wasf_response = wasf_command(addresses=[addy])


# Reset the command so that we can call it again.
wasp_response = wasf_command(addresses=[addy])
if wasp_response['states'][0]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if wasp_response['states'][0]:
if wasf_response['states'][0]:

@todofixthis
Copy link
Contributor

Looking at Chris's comment (iotaledger/iota.js#427 (comment)), I'm wondering if we should hold off on this change until we implement the account module in PyOTA — it seems like the changes needed to implement that will conflict with what's being proposed in this PR. @pdecol @lzpap What do you think?

@pdecol
Copy link
Contributor Author

pdecol commented Oct 13, 2019

What I try to clarify in the other ticket is only a part of what is proposed in this PR. To be precise it is about whether or not the getBalances API call should be added to getNewAddresses and iter_used_addresses. By doing so the issues that I mentioned in the other ticket would be solved.

The other changes (adding the wereAddressesSpentFrom API call to getNewAddresses and iter_used_addresses and the change in get_account_data.py) are currently implemented that way in the JavaScript library and are needed to establish an identical behaviour between the two libraries.

@lzpap
Copy link
Member

lzpap commented Oct 14, 2019

I suggest then that we break up the PR into the two changes that you mentioned @pdecol , and put the first one on hold until we have a concept about account module in pyota.
The second change is indeed needed to establish identical behavior, I agree.
Thanks for the proactive approach @pdecol! :)

@lzpap lzpap mentioned this pull request Dec 11, 2019
@pdecol pdecol closed this by deleting the head repository Mar 1, 2023
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