Fixes build, add "mainnet" again and fixes uri

This commit is contained in:
Esteban Ordano 2014-12-02 12:40:42 -03:00
parent 2b866a8460
commit 3dbb35a708
3 changed files with 4 additions and 3 deletions

View File

@ -40,7 +40,7 @@ function Address(data, network, type) {
throw new TypeError('First argument is required, please include address data.');
}
if (network && (network !== 'livenet' && network !== 'testnet')) {
if (network && !networks.get(network)) {
throw new TypeError('Second argument must be "livenet" or "testnet".');
}

View File

@ -68,6 +68,7 @@ function getNetwork(arg) {
module.exports = {
defaultNetwork: livenet,
livenet: livenet,
mainnet: livenet,
testnet: testnet,
get: getNetwork
};

View File

@ -62,7 +62,7 @@ describe('URI', function() {
uri = new URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj');
uri.address.should.be.instanceof(bitcore.Address);
uri.network.should.equal('mainnet');
uri.network.should.equal('livenet');
uri = new URI('bitcoin:mkYY5NRvikVBY1EPtaq9fAFgquesdjqECw');
uri.address.should.be.instanceof(bitcore.Address);
@ -92,7 +92,7 @@ describe('URI', function() {
address: '1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj'
});
uri.address.should.be.instanceof(bitcore.Address);
uri.network.should.equal('mainnet');
uri.network.should.equal('livenet');
uri = new URI({
address: 'mkYY5NRvikVBY1EPtaq9fAFgquesdjqECw'