-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Fixed82num not accepting empty string as zero (#106)
* update test to accept empty string as a zero * catch empty string and return 0 for fixed82num * update tests for getToken to test for zero balance
- Loading branch information
1 parent
7708d05
commit d601c2d
Showing
5 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as NEP5 from '../../../src/api/nep5' | ||
import { DEFAULT_RPC, CONTRACTS } from '../../../src/consts' | ||
import testKeys from '../../unit/testKeys.json' | ||
|
||
describe('Integration: API NEP5', function () { | ||
describe('getToken', function () { | ||
it('get info and balance', () => { | ||
return NEP5.getToken(DEFAULT_RPC.TEST, CONTRACTS.TEST_LWTF, testKeys.c.address) | ||
.then(result => { | ||
result.should.have.keys(['name', 'symbol', 'decimals', 'totalSupply', 'balance']) | ||
result.name.should.equal('LOCALTOKEN') | ||
result.symbol.should.equal('LWTF') | ||
result.decimals.should.equal(8) | ||
result.totalSupply.should.least(1969000) | ||
result.balance.should.be.above(0) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters