-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(sdk-coin-bsc): rename bsc to bnb
Ticket: EA-709
- Loading branch information
Showing
26 changed files
with
201 additions
and
210 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
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from './lib'; | ||
export * from './bsc'; | ||
export * from './tbsc'; | ||
export * from './bscToken'; | ||
export * from './bnb'; | ||
export * from './tbnb'; | ||
export * from './bnbToken'; | ||
export * from './register'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { BitGoBase } from '@bitgo/sdk-core'; | ||
import { Bsc } from './bsc'; | ||
import { BscToken } from './bscToken'; | ||
import { Tbsc } from './tbsc'; | ||
import { Bnb } from './bnb'; | ||
import { BnbToken } from './bnbToken'; | ||
import { Tbnb } from './tbnb'; | ||
|
||
export const register = (sdk: BitGoBase): void => { | ||
sdk.register('bsc', Bsc.createInstance); | ||
sdk.register('tbsc', Tbsc.createInstance); | ||
BscToken.createTokenConstructors().forEach(({ name, coinConstructor }) => { | ||
sdk.register('bnb', Bnb.createInstance); | ||
sdk.register('tbnb', Tbnb.createInstance); | ||
BnbToken.createTokenConstructors().forEach(({ name, coinConstructor }) => { | ||
sdk.register(name, coinConstructor); | ||
}); | ||
}; |
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,41 @@ | ||
import 'should'; | ||
|
||
import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test'; | ||
import { BitGoAPI } from '@bitgo/sdk-api'; | ||
|
||
import { Bnb, Tbnb } from '../../src/index'; | ||
|
||
const bitgo: TestBitGoAPI = TestBitGo.decorate(BitGoAPI, { env: 'test' }); | ||
|
||
describe('BNB Smart Chain', function () { | ||
before(function () { | ||
bitgo.safeRegister('bnb', Bnb.createInstance); | ||
bitgo.safeRegister('tbnb', Tbnb.createInstance); | ||
bitgo.initializeTestVars(); | ||
}); | ||
|
||
describe('Basic Coin Info', function () { | ||
it('should return the right info for bnb', function () { | ||
const bnb = bitgo.coin('bnb'); | ||
|
||
bnb.should.be.an.instanceof(Bnb); | ||
bnb.getChain().should.equal('bnb'); | ||
bnb.getFamily().should.equal('bnb'); | ||
bnb.getFullName().should.equal('BNB Smart Chain'); | ||
bnb.getBaseFactor().should.equal(1e18); | ||
bnb.supportsTss().should.equal(true); | ||
}); | ||
|
||
it('should return the right info for tbnb', function () { | ||
const tbnb = bitgo.coin('tbnb'); | ||
|
||
tbnb.should.be.an.instanceof(Tbnb); | ||
tbnb.getChain().should.equal('tbnb'); | ||
tbnb.getFamily().should.equal('bnb'); | ||
tbnb.getFullName().should.equal('Testnet BNB Smart Chain'); | ||
tbnb.getBaseFactor().should.equal(1e18); | ||
tbnb.supportsTss().should.equal(true); | ||
tbnb.allowsAccountConsolidations().should.equal(true); | ||
}); | ||
}); | ||
}); |
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,32 @@ | ||
import 'should'; | ||
|
||
import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test'; | ||
import { BnbToken } from '../../src'; | ||
import { BitGoAPI } from '@bitgo/sdk-api'; | ||
|
||
describe('Bnb Token:', function () { | ||
let bitgo: TestBitGoAPI; | ||
let bnbTokenCoin; | ||
const tokenName = 'tbnb:busd'; | ||
|
||
before(function () { | ||
bitgo = TestBitGo.decorate(BitGoAPI, { env: 'test' }); | ||
BnbToken.createTokenConstructors().forEach(({ name, coinConstructor }) => { | ||
bitgo.safeRegister(name, coinConstructor); | ||
}); | ||
bitgo.initializeTestVars(); | ||
bnbTokenCoin = bitgo.coin(tokenName); | ||
}); | ||
|
||
it('should return constants', function () { | ||
bnbTokenCoin.getChain().should.equal('tbnb:busd'); | ||
bnbTokenCoin.getBaseChain().should.equal('tbnb'); | ||
bnbTokenCoin.getFullName().should.equal('Bnb Token'); | ||
bnbTokenCoin.getBaseFactor().should.equal(1e18); | ||
bnbTokenCoin.type.should.equal(tokenName); | ||
bnbTokenCoin.name.should.equal('Test BNB USD Token'); | ||
bnbTokenCoin.coin.should.equal('tbnb'); | ||
bnbTokenCoin.network.should.equal('Testnet'); | ||
bnbTokenCoin.decimalPlaces.should.equal(18); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.