|
| 1 | +import 'should'; |
| 2 | + |
| 3 | +import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test'; |
| 4 | +import { BitGoAPI } from '@bitgo/sdk-api'; |
| 5 | +import { CosmosToken } from '../../src'; |
| 6 | + |
| 7 | +describe('Cosmos Tokens', function () { |
| 8 | + let bitgo: TestBitGoAPI; |
| 9 | + let mainnetCosmosToken; |
| 10 | + let testnetCosmosToken; |
| 11 | + const testnetTokenName = 'thash:ylds'; |
| 12 | + const mainnetTokenName = 'hash:ylds'; |
| 13 | + |
| 14 | + before(function () { |
| 15 | + bitgo = TestBitGo.decorate(BitGoAPI, { env: 'test' }); |
| 16 | + CosmosToken.createTokenConstructors().forEach(({ name, coinConstructor }) => { |
| 17 | + bitgo.safeRegister(name, coinConstructor); |
| 18 | + }); |
| 19 | + bitgo.initializeTestVars(); |
| 20 | + mainnetCosmosToken = bitgo.coin(mainnetTokenName); |
| 21 | + testnetCosmosToken = bitgo.coin(testnetTokenName); |
| 22 | + }); |
| 23 | + |
| 24 | + it('should return constants for Hash YLDS testnet token', function () { |
| 25 | + testnetCosmosToken.getChain().should.equal(testnetTokenName); |
| 26 | + testnetCosmosToken.getBaseChain().should.equal('thash'); |
| 27 | + testnetCosmosToken.getFullName().should.equal('Hash Token'); |
| 28 | + testnetCosmosToken.getBaseFactor().should.equal(1e6); |
| 29 | + testnetCosmosToken.type.should.equal(testnetTokenName); |
| 30 | + testnetCosmosToken.name.should.equal('Testnet YLDS Token'); |
| 31 | + testnetCosmosToken.coin.should.equal('thash'); |
| 32 | + testnetCosmosToken.network.should.equal('Testnet'); |
| 33 | + testnetCosmosToken.denom.should.equal('uylds.fcc'); |
| 34 | + testnetCosmosToken.decimalPlaces.should.equal(6); |
| 35 | + }); |
| 36 | + |
| 37 | + it('should return constants for Hash YLDS mainnet token', function () { |
| 38 | + mainnetCosmosToken.getChain().should.equal(mainnetTokenName); |
| 39 | + mainnetCosmosToken.getBaseChain().should.equal('hash'); |
| 40 | + mainnetCosmosToken.getFullName().should.equal('Hash Token'); |
| 41 | + mainnetCosmosToken.getBaseFactor().should.equal(1e6); |
| 42 | + mainnetCosmosToken.type.should.equal(mainnetTokenName); |
| 43 | + mainnetCosmosToken.name.should.equal('YLDS Token'); |
| 44 | + mainnetCosmosToken.coin.should.equal('hash'); |
| 45 | + mainnetCosmosToken.network.should.equal('Mainnet'); |
| 46 | + mainnetCosmosToken.denom.should.equal('uylds.fcc'); |
| 47 | + mainnetCosmosToken.decimalPlaces.should.equal(6); |
| 48 | + }); |
| 49 | +}); |
0 commit comments