Skip to content

Commit 4e87fb1

Browse files
committed
Merge PR #850 from 'nodech/script-mathop-tests'
2 parents ab61103 + 8e44e7e commit 4e87fb1

File tree

3 files changed

+396
-3
lines changed

3 files changed

+396
-3
lines changed

test/data/script-tests.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10735,6 +10735,18 @@
1073510735
"flags": [],
1073610736
"result": "NEGATIVE_LOCKTIME"
1073710737
},
10738+
{
10739+
"comments": "CHECKLOCKTIMEVERIFY automatically fails if stack top is negative",
10740+
"script": "OP_CHECKLOCKTIMEVERIFY",
10741+
"value": 0,
10742+
"witness": [
10743+
"81"
10744+
],
10745+
"locktime": 0,
10746+
"sequence": 4294967295,
10747+
"flags": [],
10748+
"result": "NEGATIVE_LOCKTIME"
10749+
},
1073810750
{
1073910751
"comments": "CSV fails if stack top is not minimally encoded",
1074010752
"script": "OP_CHECKSEQUENCEVERIFY",

test/getwork-test.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ const {wdb} = node.require('walletdb');
2222

2323
let wallet = null;
2424

25+
const TIMEOUT = 45000;
26+
2527
describe('Get Work', function() {
26-
this.timeout(45000);
28+
this.timeout(TIMEOUT);
2729

2830
it('should open chain and miner', async () => {
2931
await node.open();
@@ -36,13 +38,15 @@ describe('Get Work', function() {
3638
});
3739

3840
it('should mine 10 blocks', async () => {
39-
const connectEvents = forEvent(chain, 'connect', 10, 10000);
41+
const DELAY = 500;
42+
const waits = DELAY * 10;
43+
const connectEvents = forEvent(chain, 'connect', 10, TIMEOUT - waits);
4044
for (let i = 0; i < 10; i++) {
4145
const block = await miner.mineBlock();
4246
assert(block);
4347
await chain.add(block);
4448
// lower mtp.
45-
await sleep(500);
49+
await sleep(DELAY);
4650
}
4751

4852
await connectEvents;

0 commit comments

Comments
 (0)