Skip to content

Commit

Permalink
Merge PR #850 from 'nodech/script-mathop-tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
nodech committed Sep 24, 2023
2 parents ab61103 + 8e44e7e commit 4e87fb1
Show file tree
Hide file tree
Showing 3 changed files with 396 additions and 3 deletions.
12 changes: 12 additions & 0 deletions test/data/script-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -10735,6 +10735,18 @@
"flags": [],
"result": "NEGATIVE_LOCKTIME"
},
{
"comments": "CHECKLOCKTIMEVERIFY automatically fails if stack top is negative",
"script": "OP_CHECKLOCKTIMEVERIFY",
"value": 0,
"witness": [
"81"
],
"locktime": 0,
"sequence": 4294967295,
"flags": [],
"result": "NEGATIVE_LOCKTIME"
},
{
"comments": "CSV fails if stack top is not minimally encoded",
"script": "OP_CHECKSEQUENCEVERIFY",
Expand Down
10 changes: 7 additions & 3 deletions test/getwork-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ const {wdb} = node.require('walletdb');

let wallet = null;

const TIMEOUT = 45000;

describe('Get Work', function() {
this.timeout(45000);
this.timeout(TIMEOUT);

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

it('should mine 10 blocks', async () => {
const connectEvents = forEvent(chain, 'connect', 10, 10000);
const DELAY = 500;
const waits = DELAY * 10;
const connectEvents = forEvent(chain, 'connect', 10, TIMEOUT - waits);
for (let i = 0; i < 10; i++) {
const block = await miner.mineBlock();
assert(block);
await chain.add(block);
// lower mtp.
await sleep(500);
await sleep(DELAY);
}

await connectEvents;
Expand Down
Loading

0 comments on commit 4e87fb1

Please sign in to comment.