Skip to content

Commit b7c422f

Browse files
feat(bitgo): extend utxoCoins test to cover new fields
Issue: BTC-1450
1 parent a891814 commit b7c422f

File tree

1 file changed

+33
-34
lines changed
  • modules/bitgo/test/v2/unit/coins/utxo

1 file changed

+33
-34
lines changed
Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,38 @@
1-
/**
2-
* prettier
3-
*/
4-
import 'should';
1+
import * as assert from 'assert';
52
import * as utxolib from '@bitgo/utxo-lib';
3+
64
import { getUtxoCoinForNetwork, utxoCoins } from './util';
75

86
describe('utxoCoins', function () {
97
it('has expected chain/network values for items', function () {
10-
utxoCoins
11-
.map((c) => [c.getChain(), utxolib.getNetworkName(c.network)])
12-
.should.eql([
13-
['btc', 'bitcoin'],
14-
['tbtc', 'testnet'],
15-
['tbtcsig', 'bitcoinPublicSignet'],
16-
['tbtc4', 'bitcoinTestnet4'],
17-
['tbtcbgsig', 'bitcoinBitGoSignet'],
18-
['bch', 'bitcoincash'],
19-
['tbch', 'bitcoincashTestnet'],
20-
['btg', 'bitcoingold'],
21-
['bsv', 'bitcoinsv'],
22-
['tbsv', 'bitcoinsvTestnet'],
23-
['dash', 'dash'],
24-
['tdash', 'dashTest'],
25-
['doge', 'dogecoin'],
26-
['tdoge', 'dogecoinTest'],
27-
['bcha', 'ecash'],
28-
['tbcha', 'ecashTest'],
29-
['ltc', 'litecoin'],
30-
['tltc', 'litecoinTest'],
31-
['zec', 'zcash'],
32-
['tzec', 'zcashTest'],
33-
]);
8+
assert.deepStrictEqual(
9+
utxoCoins.map((c) => [c.getChain(), c.getFamily(), c.getFullName(), utxolib.getNetworkName(c.network)]),
10+
[
11+
['btc', 'btc', 'Bitcoin', 'bitcoin'],
12+
['tbtc', 'btc', 'Testnet Bitcoin', 'testnet'],
13+
['tbtcsig', 'btc', 'Public Signet Bitcoin', 'bitcoinPublicSignet'],
14+
['tbtc4', 'btc', 'Testnet4 Bitcoin', 'bitcoinTestnet4'],
15+
['tbtcbgsig', 'btc', 'BitGo Signet Bitcoin', 'bitcoinBitGoSignet'],
16+
['bch', 'bch', 'Bitcoin Cash', 'bitcoincash'],
17+
['tbch', 'bch', 'Testnet Bitcoin Cash', 'bitcoincashTestnet'],
18+
['btg', 'btg', 'Bitcoin Gold', 'bitcoingold'],
19+
['bsv', 'bsv', 'Bitcoin SV', 'bitcoinsv'],
20+
['tbsv', 'bsv', 'Testnet Bitcoin SV', 'bitcoinsvTestnet'],
21+
['dash', 'dash', 'Dash', 'dash'],
22+
['tdash', 'tdash', 'Testnet Dash', 'dashTest'],
23+
['doge', 'doge', 'Dogecoin', 'dogecoin'],
24+
['tdoge', 'doge', 'Testnet Dogecoin', 'dogecoinTest'],
25+
['bcha', 'bcha', 'Bitcoin ABC', 'ecash'],
26+
['tbcha', 'bcha', 'Testnet Bitcoin ABC', 'ecashTest'],
27+
['ltc', 'ltc', 'Litecoin', 'litecoin'],
28+
['tltc', 'ltc', 'Testnet Litecoin', 'litecoinTest'],
29+
['zec', 'zec', 'ZCash', 'zcash'],
30+
['tzec', 'zec', 'Testnet ZCash', 'zcashTest'],
31+
]
32+
);
3433

35-
utxolib
36-
.getNetworkList()
37-
.map((network): [string | undefined, string | undefined] => {
34+
assert.deepStrictEqual(
35+
utxolib.getNetworkList().map((network): [string | undefined, string | undefined] => {
3836
let coin;
3937
try {
4038
coin = getUtxoCoinForNetwork(network);
@@ -43,8 +41,8 @@ describe('utxoCoins', function () {
4341
}
4442

4543
return [utxolib.getNetworkName(network), coin?.getChain()];
46-
})
47-
.should.eql([
44+
}),
45+
[
4846
['bitcoin', 'btc'],
4947
['testnet', 'tbtc'],
5048
['bitcoinPublicSignet', 'tbtcsig'],
@@ -66,6 +64,7 @@ describe('utxoCoins', function () {
6664
['litecoinTest', 'tltc'],
6765
['zcash', 'zec'],
6866
['zcashTest', 'tzec'],
69-
]);
67+
]
68+
);
7069
});
7170
});

0 commit comments

Comments
 (0)