Change type (reserved keyword) for scriptType

This commit is contained in:
Esteban Ordano 2014-11-21 15:07:15 -03:00
parent 43ffce4e20
commit 87050b74b6
1 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ The code to do these validations looks like this:
var address = new bitcore.Address('1BitcoinAddress...');
assert(address.network === bitcore.network.livenet);
// Detect the kind of the address...
assert(address.type === bitcore.Address.Pay2PubKeyHash);
assert(address.scriptType === bitcore.Address.Pay2PubKeyHash);
```
There are also static methods for this that work very similarly:
@ -25,6 +25,6 @@ There are also static methods for this that work very similarly:
var address = new bitcore.Address();
assert(bitcore.Address.isValid('1BitcoinAddress...'));
assert(bitcore.Address.network('1BitcoinAddress...') === bitcore.network.livenet);
assert(bitcore.Address.type('1BitcoinAddress...') !== bitcore.Address.Pay2ScriptHash);
assert(bitcore.Address.type('3MultisigP2SH...') === bitcore.Address.Pay2ScriptHash);
assert(bitcore.Address.scriptType('1BitcoinAddress...') !== bitcore.Address.Pay2ScriptHash);
assert(bitcore.Address.scriptType('3MultisigP2SH...') === bitcore.Address.Pay2ScriptHash);
```