Skip to content

Commit

Permalink
Adjusting equals operator to use UInt64
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Jan 20, 2024
1 parent e371006 commit 8711106
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chain/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export namespace Asset {
if (toSymbolPrecision(value) > Symbol.maxPrecision) {
throw new Error('Invalid asset symbol, precision too large')
}
if (value !== UInt64.from(0) && !SymbolCode.pattern.test(toSymbolName(value))) {
if (!value.equals(0) && !SymbolCode.pattern.test(toSymbolName(value))) {
throw new Error('Invalid asset symbol, name must be uppercase A-Z')
}
this.value = value
Expand Down Expand Up @@ -232,7 +232,7 @@ export namespace Asset {
value: UInt64

constructor(value: UInt64) {
if (value !== UInt64.from(0) && !SymbolCode.pattern.test(toSymbolName(value))) {
if (!value.equals(0) && !SymbolCode.pattern.test(toSymbolName(value))) {
throw new Error('Invalid asset symbol, name must be uppercase A-Z')
}
this.value = value
Expand Down

0 comments on commit 8711106

Please sign in to comment.