add (some) fromAddress and getInType tests to script
This commit is contained in:
parent
c3880c0cdf
commit
83381186d1
2 changed files with 34 additions and 6 deletions
src
|
@ -150,6 +150,7 @@ Script.prototype.toScriptHash = function() {
|
|||
return util.sha256ripe160(this.buffer)
|
||||
}
|
||||
|
||||
//TODO: support testnet
|
||||
Script.prototype.getToAddress = function() {
|
||||
var outType = this.getOutType();
|
||||
|
||||
|
@ -164,6 +165,11 @@ Script.prototype.getToAddress = function() {
|
|||
return new Address(this.chunks[1], 5)
|
||||
}
|
||||
|
||||
//TODO: support testnet
|
||||
Script.prototype.getFromAddress = function(){
|
||||
return new Address(this.simpleInHash());
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare the script to known templates of scriptSig.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue