Move: Script and Interpreter into subfolder
This commit is contained in:
parent
f8d070c3d3
commit
ce94626908
1
index.js
1
index.js
|
@ -42,7 +42,6 @@ bitcore.PaymentProtocol = require('./lib/paymentprotocol');
|
|||
bitcore.PrivateKey = require('./lib/privatekey');
|
||||
bitcore.PublicKey = require('./lib/publickey');
|
||||
bitcore.Script = require('./lib/script');
|
||||
bitcore.ScriptInterpreter = require('./lib/script_interpreter');
|
||||
bitcore.Transaction = require('./lib/transaction');
|
||||
bitcore.URI = require('./lib/uri');
|
||||
bitcore.Unit = require('./lib/unit');
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = require('./script');
|
||||
|
||||
module.exports.Interpreter = require('./interpreter');
|
|
@ -3,14 +3,13 @@
|
|||
var _ = require('lodash');
|
||||
|
||||
var Script = require('./script');
|
||||
var Opcode = require('./opcode');
|
||||
var BN = require('./crypto/bn');
|
||||
var Hash = require('./crypto/hash');
|
||||
var BufferReader = require('./encoding/bufferreader');
|
||||
var BufferWriter = require('./encoding/bufferwriter');
|
||||
var Signature = require('./crypto/signature');
|
||||
var PublicKey = require('./publickey');
|
||||
var Transaction = require('./transaction');
|
||||
var Opcode = require('../opcode');
|
||||
var BN = require('../crypto/bn');
|
||||
var Hash = require('../crypto/hash');
|
||||
var BufferReader = require('../encoding/bufferreader');
|
||||
var BufferWriter = require('../encoding/bufferwriter');
|
||||
var Signature = require('../crypto/signature');
|
||||
var PublicKey = require('../publickey');
|
||||
|
||||
/**
|
||||
* Bitcoin transactions contain scripts. Each input has a script called the
|
||||
|
@ -1056,6 +1055,7 @@ ScriptInterpreter.prototype.step = function() {
|
|||
* Translated from bitcoind's VerifyScript
|
||||
*/
|
||||
ScriptInterpreter.prototype.verify = function(scriptSig, scriptPubkey, tx, nin, flags) {
|
||||
var Transaction = require('../transaction');
|
||||
if (_.isUndefined(tx)) {
|
||||
tx = new Transaction();
|
||||
}
|
|
@ -1,20 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
|
||||
var Address = require('./address');
|
||||
var BufferReader = require('./encoding/bufferreader');
|
||||
var BufferWriter = require('./encoding/bufferwriter');
|
||||
var Hash = require('./crypto/hash');
|
||||
var Opcode = require('./opcode');
|
||||
var PublicKey = require('./publickey');
|
||||
var Signature = require('./crypto/signature');
|
||||
var Address = require('../address');
|
||||
var BufferReader = require('../encoding/bufferreader');
|
||||
var BufferWriter = require('../encoding/bufferwriter');
|
||||
var Hash = require('../crypto/hash');
|
||||
var Opcode = require('../opcode');
|
||||
var PublicKey = require('../publickey');
|
||||
var Signature = require('../crypto/signature');
|
||||
|
||||
var $ = require('./util/preconditions');
|
||||
var $ = require('../util/preconditions');
|
||||
var _ = require('lodash');
|
||||
var errors = require('./errors');
|
||||
var errors = require('../errors');
|
||||
var buffer = require('buffer');
|
||||
var BufferUtil = require('./util/buffer');
|
||||
var jsUtil = require('./util/js');
|
||||
var BufferUtil = require('../util/buffer');
|
||||
var JSUtil = require('../util/js');
|
||||
|
||||
/**
|
||||
* A bitcoin transaction script. Each transaction's inputs and outputs
|
||||
|
@ -127,7 +127,7 @@ Script.prototype.toBuffer = function() {
|
|||
};
|
||||
|
||||
Script.fromString = function(str) {
|
||||
if (jsUtil.isHexa(str) || str.length === 0) {
|
||||
if (JSUtil.isHexa(str) || str.length === 0) {
|
||||
return new Script(new buffer.Buffer(str, 'hex'));
|
||||
}
|
||||
var script = new Script();
|
|
@ -5,7 +5,7 @@ var bitcore = require('../..');
|
|||
var BN = bitcore.crypto.BN;
|
||||
var Signature = bitcore.crypto.Signature;
|
||||
var JSUtil = bitcore.util.js;
|
||||
var ScriptInterpreter = bitcore.ScriptInterpreter;
|
||||
var ScriptInterpreter = bitcore.Script.Interpreter;
|
||||
|
||||
var sig_canonical = require('../data/bitcoind/sig_canonical');
|
||||
var sig_noncanonical = require('../data/bitcoind/sig_noncanonical');
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
var should = require('chai').should();
|
||||
var bitcore = require('..');
|
||||
var ScriptInterpreter = bitcore.ScriptInterpreter;
|
||||
var ScriptInterpreter = bitcore.Script.Interpreter;
|
||||
var Transaction = bitcore.Transaction;
|
||||
var Script = bitcore.Script;
|
||||
var BN = bitcore.crypto.BN;
|
||||
|
|
Loading…
Reference in New Issue