-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostCompile.ts
More file actions
29 lines (21 loc) · 820 Bytes
/
postCompile.ts
File metadata and controls
29 lines (21 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import * as fs from 'fs';
import * as path from 'path';
/////////////////////////////////////
const filePathTestMerklePath = path.resolve(__dirname, './artifacts/tests/testMerklePath.json');
fs.readFile(filePathTestMerklePath, 'utf8', (err, data) => {
if (err) {
console.error('Error reading file:', err);
return;
}
// Replace occurrences of "OP_2 OP_MUL" with "OP_DUP OP_ADD",
// since BTC doesn't support OP_MUL...
const result = data.replace(/5295/g, '7693');
fs.writeFile(filePathTestMerklePath, result, 'utf8', (err) => {
if (err) {
console.error('Error writing file:', err);
return;
}
console.log('Post-compile hook completed for:', filePathTestMerklePath.toString())
});
});
/////////////////////////////////////