-
Notifications
You must be signed in to change notification settings - Fork 287
The behaviour of getAccountData, getInputs and getNewAddress for addresses with balance and without transactions #427
Comments
Hi @pdecol those issues are solved in
There might be an address at any index that isn't spend and has no balance/transactions. This wouldn't include addresses at higher index. |
Hey @chrisdukakis thanks for your response. No, I have never used the account module. But of course, with the statefulness of this module, you should not have these issues. I just thought It would make sense to correct this on the lower API level. I think this would be useful for applications that don't (want to) use the account module and rather work directly with the APIs. Does this make sense? Or is it recommended to always use the account module and there is no need to use these APIs directly?
Sure, there is no perfect solution with only the stateless APIs because eventually, it has to stop searching at some point. But with these changes, there would be some cases where more inputs would be found which makes it a bit more convenient to use. |
Hey @chrisdukakis and @pdecol, I would like to point out however, that as a user of the IOTA libs, I have certain expectations from the API. If I call a method called Also from a user perspective, it is a bit strange for me to have API call The one thing we could do is to add that extra "and has no balance" check to I'm just brainstorming, let me know what you think :) |
Hey @lzpap , in any case it won't work reliably unless we add state. |
Closing as this relates to an unmaintained branch of the library, which will be incompatible with the new Chrysalis release of the network. |
Description
I noticed that the IOTA Python library has implemented these commands in a none snapshot resistant and none intuitive way (iotaledger/iota.py#217). To keep the behaviour of the client libraries consistent I tested these commands with the JavaScript library. I noticed odd results if a
start
parameter is given but noend
for addresses that have a balance but no transactions due to a snapshot.getInputs stops searching at such addresses and does not continue to search for more inputs. It certainly would be expected and convenient if it would continue to search for more inputs.
newAddress returns such an address. This is strange because it will not return such an address if there is a balance and a zero value transaction. Also, I would not consider such an address as "new".
getAccountData stops searching at such an address and does not return the balance. This seems like a bug to me. It should return the balance and continue searching.
In my opinion, getInputs and getAccountData should stop only if they find an address where it was not spent from and has no balance and has no transaction. newAddress should return the first address that was not spent from and has no balance and has no transaction.
Motivation
The methods should work in a consistent and expected way. All IOTA libraries should implement it in the same way.
Am I planning to do it myself with a PR?
No. I want to discuss and clarify how IOTA libraries should implement these methods and implement it that way for the Python library.
The text was updated successfully, but these errors were encountered: