Closed dexX7 closed 9 years ago
Side note: While probably not directly related, I opened this issue in the context of https://github.com/mastercoin-MSC/omniwallet/issues/1184#issuecomment-68361027. (ping @achamely)
@zathras-crypto may chime in too, for masterchest's sake in the key integrator role :)
If the user has never interacted with the property, an exception is thrown as well.
Disagree mate, we only ever check previous interaction for getall functions. Eg getbalance_MP on a never used property:
zathras@coredev01:~/github/build/mastercore$ src/mastercored getbalance_MP 1zAtHRASgdHvZDfHs6xJquMghga4eG7gy 6
{
"balance" : "0",
"reserved" : "0"
}
Is it an exceptional situation, if the property doesn't exist?
Yes, in my opinion. Core only shows properties that exist as showing you have a zero balance of ZathrasCoins incorrectly implies ZathrasCoins exist in the first place.
Disagree mate, we only ever check previous interaction for getall functions.
Ah right, I mixed the bahavior with https://github.com/mastercoin-MSC/mastercore/issues/93 (gettransaction_MP throws exception, if transaction is unconfirmed).
In this case I agree with current behavior, and in particular regarding non-existing properties.
When retireving a balance for an address and a property, there are basically the following scenarios and combinations thereof:
Properties:
Balances:
The current behavior is as follows, IIRC:
If the user has never interacted with the property, an exception is thrown as well.had some balance in the past, buthas a zero balance at the moment, a zero balance is returned.I left out the obvious case: wrong user input, say for example an out-of-range property id is provided. In this case without a doubt an exception should be thrown.
Now what I'm wondering about is basically: is it really an exceptional situation, if the user has never transacted with a property? Is it an exceptional situation, if the property doesn't exist? How does it matter, whether there was some previous transaction involving a property or not?
It can be said: a user has a zero balance of X, in any case, whether X exists or was interacted with in the past. It's a fine line and probably application dependant what the right route is, but I'm interested in your opinion.
Edit: how is *never defined here? Edit: unconfirmed transactions are not supported and "do not really exist", bluntly said.