-
Notifications
You must be signed in to change notification settings - Fork 142
Some fixes 2 #892
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
Some fixes 2 #892
Changes from all commits
d331c27
cee9272
5d836bf
4ff6573
8196028
62ac62b
3516343
7e02b27
ba1d696
3fe0f29
d14afe0
dedf201
0a176ed
dbc1c09
8518f3f
d40c147
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,7 @@ export class Memo { | |
| } | ||
|
|
||
| static _validateIdValue(value) { | ||
| const error = new Error(`Expects a int64 as a string. Got ${value}`); | ||
| const error = new Error(`Expects a uint64 as a string. Got ${value}`); | ||
|
|
||
| if (typeof value !== 'string') { | ||
| throw error; | ||
|
|
@@ -118,6 +118,21 @@ export class Memo { | |
| if (number.isNaN()) { | ||
| throw error; | ||
| } | ||
|
|
||
| // Negative | ||
| if (number.isNegative()) { | ||
| throw error; | ||
| } | ||
|
|
||
| // Decimal | ||
| if (!number.isInteger()) { | ||
| throw error; | ||
| } | ||
|
|
||
| // Exceeds uint64 max (2^64 - 1) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it int64 not uint64?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I confirmed the xdr says uin64
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for checking, @Ryang-21! |
||
| if (number.isGreaterThan('18446744073709551615')) { | ||
| throw error; | ||
| } | ||
| } | ||
|
|
||
| static _validateTextValue(value) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.