-
Notifications
You must be signed in to change notification settings - Fork 45
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
Ppe/uncommitted state #311
Conversation
61c1d10
to
4b8c874
Compare
bab9299
to
a8ba348
Compare
802a8b2
to
6e49d10
Compare
3552618
to
f889faa
Compare
@@ -73,6 +73,10 @@ export function handle(state, action) { | |||
const recipient = _input.recipient; | |||
const amount = _input.amount; | |||
|
|||
if (amount == 0 ) { | |||
throw new ContractError('TransferFromZero'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is amount
the sender balance (transfer-FROM-zero
suggests that)? Shouldn't we check whether amount <= 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a real contract - yes.
This contract is a simplified, stripped-down version (I believe there's a warn in the header -
* This is an example token contract that mimics the |
for (i = 0; i < string.length; i++) { | ||
chr = string.charCodeAt(i); | ||
hash = (hash << 5) - hash + chr; | ||
hash |= 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't |= 0
basically noop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, it's a compiled code (probably generated by the TS compiler), so hard for me to say.
BUT...I believe the idea here is to use '0' as the 'default' value, in case the previous assignments would result in sth like NaN, null, or whatever.
794898e
to
ce0271d
Compare
|
649e612
to
2366f9d
Compare
2366f9d
to
198d013
Compare
198d013
to
6cd7ce6
Compare
#290 🤯