fix: add testnetChannelEndpoint()

This commit is contained in:
Michael Vines
2018-12-19 19:28:28 -08:00
parent b5d058e88f
commit 62c1efc955
8 changed files with 69 additions and 14 deletions

View File

@ -0,0 +1,18 @@
// @flow
import {testnetChannelEndpoint} from '../src/util/testnet';
test('invalid', () => {
expect(() => {
testnetChannelEndpoint('abc123');
}).toThrow();
});
test('edge', () => {
expect(testnetChannelEndpoint('edge')).toEqual(
'https://api.edge.testnet.solana.com',
);
});
test('default', () => {
testnetChannelEndpoint(); // Should not throw
});

View File

@ -6,8 +6,12 @@
export const url = 'http://localhost:8899/';
//export const url = 'http://edge.testnet.solana.com:8899/';
//export const url = 'http://beta.edge.testnet.solana.com:8899/';
/*
export const url = 'http://edge.testnet.solana.com:8899/';
export const url = 'http://beta.testnet.solana.com:8899/';
export const url = 'http://testnet.solana.com:8899/';
//export const url = 'http://testnet.solana.com:8899/';
//export const url = 'https://api.testnet.solana.com/';
export const url = 'https://api.edge.testnet.solana.com/';
export const url = 'https://api.beta.testnet.solana.com/';
export const url = 'https://api.testnet.solana.com/';
*/