Added tests for single slash. Removed some unused code.
This commit is contained in:
parent
3b74ab7d8c
commit
217b02504a
2 changed files with 22 additions and 13 deletions
|
|
@ -138,6 +138,17 @@ fdescribe('bitcoinUriService', function() {
|
|||
expect(parsed.testnet).toBe(false);
|
||||
});
|
||||
|
||||
it('Bitcoin uri with slash', function() {
|
||||
|
||||
var parsed = bitcoinUriService.parse('bitcoin:/1GhpYmbRaf73AZRxDwAGr6653iZBGzdgeA');
|
||||
|
||||
expect(parsed.isValid).toBe(true);
|
||||
expect(parsed.coin).toBe('btc');
|
||||
expect(parsed.publicAddress.asReceived).toBe('1GhpYmbRaf73AZRxDwAGr6653iZBGzdgeA');
|
||||
expect(parsed.publicAddress.legacy).toBe('1GhpYmbRaf73AZRxDwAGr6653iZBGzdgeA');
|
||||
expect(parsed.testnet).toBe(false);
|
||||
});
|
||||
|
||||
it('Bitcoin uri with slashes', function() {
|
||||
|
||||
var parsed = bitcoinUriService.parse('bitcoin://18PCPhgZJjLxe9g3Q1BXLpL5aVut1fW3aX');
|
||||
|
|
@ -215,6 +226,17 @@ fdescribe('bitcoinUriService', function() {
|
|||
expect(parsed.testnet).toBe(false);
|
||||
});
|
||||
|
||||
it('cashAddr with slash', function() {
|
||||
|
||||
var parsed = bitcoinUriService.parse('bitcoincash:/qzdectfmuw0xxztfx7mh045830dqcshj85hr44l35a');
|
||||
|
||||
expect(parsed.isValid).toBe(true);
|
||||
expect(parsed.coin).toBe('bch');
|
||||
expect(parsed.publicAddress.asReceived).toBe('qzdectfmuw0xxztfx7mh045830dqcshj85hr44l35a');
|
||||
expect(parsed.publicAddress.legacy).toBe('1FBnq5gZhzTvvcJBjA7C2P3bKQZCiJaG1x');
|
||||
expect(parsed.testnet).toBe(false);
|
||||
});
|
||||
|
||||
it('cashAddr with slashes', function() {
|
||||
|
||||
var parsed = bitcoinUriService.parse('bitcoincash://qpj966w8utue75lqqq3rlgh20zkz3rmydqpq8syv9c');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue