fix more tests broken in last rebase
This commit is contained in:
parent
4ba6eeafb5
commit
13350d21b3
2 changed files with 22 additions and 7 deletions
|
|
@ -15,10 +15,6 @@ var PublicKeyRing = copay.PublicKeyRing;
|
||||||
var aMasterPubKey = 'tprv8ZgxMBicQKsPdSVTiWXEqCCzqRaRr9EAQdn5UVMpT9UHX67Dh1FmzEMbavPumpAicsUm2XvC6NTdcWB89yN5DUWx5HQ7z3KByUg7Ht74VRZ';
|
var aMasterPubKey = 'tprv8ZgxMBicQKsPdSVTiWXEqCCzqRaRr9EAQdn5UVMpT9UHX67Dh1FmzEMbavPumpAicsUm2XvC6NTdcWB89yN5DUWx5HQ7z3KByUg7Ht74VRZ';
|
||||||
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
networkName:'livenet',
|
|
||||||
};
|
|
||||||
|
|
||||||
var createW = function (networkName) {
|
var createW = function (networkName) {
|
||||||
var config = {
|
var config = {
|
||||||
networkName: networkName || 'livenet',
|
networkName: networkName || 'livenet',
|
||||||
|
|
@ -41,6 +37,10 @@ var createW = function (networkName) {
|
||||||
describe('PublicKeyRing model', function() {
|
describe('PublicKeyRing model', function() {
|
||||||
|
|
||||||
it('should create an instance (livenet)', function () {
|
it('should create an instance (livenet)', function () {
|
||||||
|
var config = {
|
||||||
|
networkName:'livenet',
|
||||||
|
};
|
||||||
|
|
||||||
var w = new PublicKeyRing({
|
var w = new PublicKeyRing({
|
||||||
networkName: config.networkName
|
networkName: config.networkName
|
||||||
});
|
});
|
||||||
|
|
@ -54,6 +54,9 @@ describe('PublicKeyRing model', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fail to generate shared pub keys wo extended key', function () {
|
it('should fail to generate shared pub keys wo extended key', function () {
|
||||||
|
var config = {
|
||||||
|
networkName:'livenet',
|
||||||
|
};
|
||||||
var w2 = new PublicKeyRing(config);
|
var w2 = new PublicKeyRing(config);
|
||||||
should.exist(w2);
|
should.exist(w2);
|
||||||
|
|
||||||
|
|
@ -239,6 +242,9 @@ describe('PublicKeyRing model', function() {
|
||||||
|
|
||||||
|
|
||||||
it('#merge pubkey tests', function () {
|
it('#merge pubkey tests', function () {
|
||||||
|
var config = {
|
||||||
|
networkName:'livenet',
|
||||||
|
};
|
||||||
var w = new PublicKeyRing(config);
|
var w = new PublicKeyRing(config);
|
||||||
should.exist(w);
|
should.exist(w);
|
||||||
var copayers = [];
|
var copayers = [];
|
||||||
|
|
@ -268,6 +274,9 @@ describe('PublicKeyRing model', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('#merge pubkey tests (case 2)', function () {
|
it('#merge pubkey tests (case 2)', function () {
|
||||||
|
var config = {
|
||||||
|
networkName:'livenet',
|
||||||
|
};
|
||||||
var w = new PublicKeyRing(config);
|
var w = new PublicKeyRing(config);
|
||||||
should.exist(w);
|
should.exist(w);
|
||||||
|
|
||||||
|
|
@ -285,6 +294,9 @@ describe('PublicKeyRing model', function() {
|
||||||
|
|
||||||
|
|
||||||
it('#merge with nickname', function () {
|
it('#merge with nickname', function () {
|
||||||
|
var config = {
|
||||||
|
networkName:'livenet',
|
||||||
|
};
|
||||||
var w = new PublicKeyRing(config);
|
var w = new PublicKeyRing(config);
|
||||||
should.exist(w);
|
should.exist(w);
|
||||||
for(var i=0; i<3; i++) {
|
for(var i=0; i<3; i++) {
|
||||||
|
|
@ -319,6 +331,9 @@ describe('PublicKeyRing model', function() {
|
||||||
|
|
||||||
|
|
||||||
it('#toObj #fromObj with nickname', function () {
|
it('#toObj #fromObj with nickname', function () {
|
||||||
|
var config = {
|
||||||
|
networkName:'livenet',
|
||||||
|
};
|
||||||
var w = new PublicKeyRing(config);
|
var w = new PublicKeyRing(config);
|
||||||
should.exist(w);
|
should.exist(w);
|
||||||
for(var i=0; i<3; i++) {
|
for(var i=0; i<3; i++) {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ var Transaction = bitcore.Transaction;
|
||||||
var buffertools = bitcore.buffertools;
|
var buffertools = bitcore.buffertools;
|
||||||
var WalletKey = bitcore.WalletKey;
|
var WalletKey = bitcore.WalletKey;
|
||||||
var Key = bitcore.Key;
|
var Key = bitcore.Key;
|
||||||
var bignum = bitcore.bignum;
|
var bignum = bitcore.Bignum;
|
||||||
var Script = bitcore.Script;
|
var Script = bitcore.Script;
|
||||||
var Builder = bitcore.TransactionBuilder;
|
var Builder = bitcore.TransactionBuilder;
|
||||||
var util = bitcore.util;
|
var util = bitcore.util;
|
||||||
|
|
@ -20,11 +20,11 @@ try {
|
||||||
var fakeStorage = copay.FakeStorage;
|
var fakeStorage = copay.FakeStorage;
|
||||||
var PrivateKey = copay.PrivateKey || require('../js/models/PrivateKey');
|
var PrivateKey = copay.PrivateKey || require('../js/models/PrivateKey');
|
||||||
var TxProposals = copay.TxProposals || require('../js/models/TxProposal');
|
var TxProposals = copay.TxProposals || require('../js/models/TxProposal');
|
||||||
|
var is_browser = (typeof process == 'undefined' || typeof process.versions === 'undefined')
|
||||||
var PublicKeyRing = is_browser ? copay.PublicKeyRing :
|
var PublicKeyRing = is_browser ? copay.PublicKeyRing :
|
||||||
require('soop').load('../js/models/core/PublicKeyRing', {
|
require('soop').load('../js/models/core/PublicKeyRing', {
|
||||||
Storage: fakeStorage
|
Storage: fakeStorage
|
||||||
});
|
});
|
||||||
var is_browser = (typeof process.versions === 'undefined')
|
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
networkName: 'testnet',
|
networkName: 'testnet',
|
||||||
|
|
@ -106,7 +106,7 @@ describe('TxProposals model', function() {
|
||||||
tx = b.build();
|
tx = b.build();
|
||||||
tx.isComplete().should.equal(true);
|
tx.isComplete().should.equal(true);
|
||||||
|
|
||||||
var s = new Script(new Buffer(unspentTest[0].scriptPubKey, 'hex'));
|
var s = new Script(new bitcore.Buffer(unspentTest[0].scriptPubKey, 'hex'));
|
||||||
|
|
||||||
tx.verifyInput(0, s, {
|
tx.verifyInput(0, s, {
|
||||||
verifyP2SH: true,
|
verifyP2SH: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue