From 0f9ab0ea606dafcf9ce558168dddc1484c4c0832 Mon Sep 17 00:00:00 2001 From: Manan Patel Date: Wed, 18 Jun 2014 22:11:01 -0700 Subject: [PATCH] updating browser build --- browser/bundle.js | 48 ++++++++++++++++++++++----------------------- browser/testdata.js | 7 +++---- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/browser/bundle.js b/browser/bundle.js index 7b89a88c30a..a61c3719467 100644 --- a/browser/bundle.js +++ b/browser/bundle.js @@ -143,8 +143,8 @@ module.exports=require('hQ0t76'); },{}],"hQ0t76":[function(require,module,exports){ (function(t){function e(t){this.buffer=t?t:c.EMPTY_BUFFER,this.chunks=[],this.parse()}function r(t){return t==o.map.OP_0||t>=o.map.OP_1&&t<=o.map.OP_16}function n(t){return t=t?2:65535>=t?3:5}function s(e){var r=void 0;return e=e?(r=new t(2),r.writeUInt8(o.map.OP_PUSHDATA1,0),r.writeUInt8(e,1)):65535>=e?(r=new t(3),r.writeUInt8(o.map.OP_PUSHDATA2,0),r.writeUInt16LE(e,1)):(r=new t(5),r.writeUInt8(o.map.OP_PUSHDATA4,0),r.writeUInt32LE(e,1)),r}var u=require("soop").imports(),h=(u.config||require("../config"),u.log||require("../util/log")),o=u.Opcode||require("./Opcode"),f=u.buffertools||require("buffertools"),c=u.util||require("../util/util"),p=u.Parser||require("../util/BinaryParser"),a=u.Put||require("bufferput"),l=0,g=1,k=2,w=3,P=4,y=["unknown","pubkey","pubkeyhash","multisig","scripthash"];e.TX_UNKNOWN=l,e.TX_PUBKEY=g,e.TX_PUBKEYHASH=k,e.TX_MULTISIG=w,e.TX_SCRIPTHASH=P,e.prototype.parse=function(){this.chunks=[];for(var t=new p(this.buffer);!t.eof();){var e,r,n=t.word8();n>0&&no.map.OP_16)return!1}return!0},e.prototype.isP2SH=function(){return 3==this.chunks.length&&this.chunks[0]==o.map.OP_HASH160&&t.isBuffer(this.chunks[1])&&20==this.chunks[1].length&&this.chunks[2]==o.map.OP_EQUAL},e.prototype.isPubkey=function(){return 2==this.chunks.length&&t.isBuffer(this.chunks[0])&&this.chunks[1]==o.map.OP_CHECKSIG},e.prototype.isPubkeyHash=function(){return 5==this.chunks.length&&this.chunks[0]==o.map.OP_DUP&&this.chunks[1]==o.map.OP_HASH160&&t.isBuffer(this.chunks[2])&&20==this.chunks[2].length&&this.chunks[3]==o.map.OP_EQUALVERIFY&&this.chunks[4]==o.map.OP_CHECKSIG},e.prototype.isMultiSig=function(){return this.chunks.length>3&&r(this.chunks[0])&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return t.isBuffer(e)})&&r(this.chunks[this.chunks.length-2])&&this.chunks[this.chunks.length-1]==o.map.OP_CHECKMULTISIG},e.prototype.isP2shScriptSig=function(){if(!r(this.chunks[0])||0!==this.chunks[0])return!1;var t=new e(this.chunks[this.chunks.length-1]),n=t.classify();return n!==l},e.prototype.isMultiSigScriptSig=function(){return r(this.chunks[0])&&0===this.chunks[0]?!this.isP2shScriptSig():!1},e.prototype.countSignatures=function(){var t=0,e=this.chunks.length;return t=this.isMultiSigScriptSig()?e-1:this.isP2shScriptSig()?e-2:0===f.compare(this.getBuffer(),c.EMPTY_BUFFER)?0:1},e.prototype.countMissingSignatures=function(){if(this.isMultiSig())return h.debug("Can not count missing signatures on normal Multisig script"),null;var t=0,n=this.chunks.length;if(r(this.chunks[0])&&0===this.chunks[0]){var i=new e(this.chunks[n-1]);if(r(i.chunks[0])){var s=i.chunks[0]-80;t=s-(n-2)}else h.debug("Unrecognized script type")}else 0===f.compare(this.getBuffer(),c.EMPTY_BUFFER)&&(t=1);return t},e.prototype.finishedMultiSig=function(){var t=this.countMissingSignatures();return null===t?null:0===t},e.prototype.getMultiSigInfo=function(){if(!this.isMultiSig())throw new Error("Script.getMultiSigInfo(): Not a multiSig script.");for(var t=this.chunks[0]-80,e=this.chunks[this.chunks.length-2]-80,r=[],n=1;ni;i++){var u=this.chunks[i];if(i>0&&(n+=" "),n+=t.isBuffer(u)?"0x"+c.formatBuffer(u,e?null:0):o.reverseMap[u],r&&i>r){n+=" ...";break}}return n},e.prototype.toString=function(t,e){var r="