From 4ed1a49dc5b6d2edefa135eb37c3a3669ce5a0b4 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Wed, 30 May 2018 10:23:55 +1000 Subject: [PATCH] force update MTP if tests not run --- test/integration/cltv.js | 9 +++++++-- test/integration/csv.js | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test/integration/cltv.js b/test/integration/cltv.js index d58c1a8..14937c8 100644 --- a/test/integration/cltv.js +++ b/test/integration/cltv.js @@ -1,4 +1,4 @@ -/* global describe, it */ +/* global describe, it, before */ var assert = require('assert') var bitcoin = require('../../') @@ -10,7 +10,12 @@ var alice = bitcoin.ECPair.fromWIF('cScfkGjbzzoeewVWmU2hYPUHeVGJRDdFt7WhmrVVGkxp var bob = bitcoin.ECPair.fromWIF('cMkopUXKWsEzAjfa1zApksGRwjVpJRB3831qM9W4gKZsLwjHXA9x', regtest) describe('bitcoinjs-lib (transactions w/ CLTV)', function () { - var hashType = bitcoin.Transaction.SIGHASH_ALL + // force update MTP + before(function (done) { + regtestUtils.mine(11, done) + }) + + let hashType = bitcoin.Transaction.SIGHASH_ALL function cltvCheckSigOutput (aQ, bQ, lockTime) { return bitcoin.script.compile([ diff --git a/test/integration/csv.js b/test/integration/csv.js index 5c9dd3b..ef9c30f 100644 --- a/test/integration/csv.js +++ b/test/integration/csv.js @@ -1,4 +1,4 @@ -/* global describe, it */ +/* global describe, it, before */ let assert = require('assert') let bitcoin = require('../../') @@ -10,6 +10,11 @@ let alice = bitcoin.ECPair.fromWIF('cScfkGjbzzoeewVWmU2hYPUHeVGJRDdFt7WhmrVVGkxp let bob = bitcoin.ECPair.fromWIF('cMkopUXKWsEzAjfa1zApksGRwjVpJRB3831qM9W4gKZsLwjHXA9x', regtest) describe('bitcoinjs-lib (transactions w/ CSV)', function () { + // force update MTP + before(function (done) { + regtestUtils.mine(11, done) + }) + let hashType = bitcoin.Transaction.SIGHASH_ALL // IF MTP (from when confirmed) > seconds, aQ can redeem