@theqrl/hypc 0.0.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/build/clean.js +2 -4
- package/hypc.js +2 -2
- package/hypjson.js +47 -47
- package/linker.js +43 -32
- package/package.json +4 -4
- package/test/cli.js +1 -1
- package/test/compiler.js +21 -21
- package/test/linker.js +46 -90
- package/test/translate.js +2 -2
- package/translate.js +3 -3
- package/contractA_hyp_A.bin +0 -1
- package/contractB_hyp_B.bin +0 -1
- package/importA_hyp_C.bin +0 -1
- package/importB_hyp_D.bin +0 -1
- package/libX_hyp_X.bin +0 -1
- package/libY_hyp_Y.bin +0 -1
- package/libZ_hyp_Z.bin +0 -1
- package/test/resources/fixtureAsmJson.hyp +0 -8
- package/test/resources/fixtureAsmJson.output +0 -101
- package/test/resources/fixtureIncorrectSource.hyp +0 -1
- package/test/resources/fixtureSmoke.hyp +0 -5
- package/test/resources/importA.hyp +0 -7
- package/test/resources/importB.hyp +0 -5
- package/test/resources/importCallback/base/contractA.hyp +0 -8
- package/test/resources/importCallback/base/contractB.hyp +0 -6
- package/test/resources/importCallback/contractC.hyp +0 -4
- package/test/resources/importCallback/includeA/libX.hyp +0 -4
- package/test/resources/importCallback/includeA/libY.hyp +0 -6
- package/test/resources/importCallback/includeA/utils.hyp +0 -4
- package/test/resources/importCallback/includeB/libZ.hyp +0 -4
- package/test/resources/smtChecker/loop.hyp +0 -8
- package/test/resources/smtChecker/smoke.hyp +0 -5
- package/test/resources/smtChecker/smoke_with_engine.hyp +0 -6
- package/test/resources/smtChecker/smoke_with_multi_engine.hyp +0 -8
- package/test_resources_fixtureSmoke_hyp_C.abi +0 -1
- package/test_resources_fixtureSmoke_hyp_C.bin +0 -1
- package/test_resources_importA_hyp_C.bin +0 -1
- package/test_resources_importB_hyp_D.bin +0 -1
- package/utils_hyp_Utils.bin +0 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ Having absolute paths in contract metadata will result in your bytecode being re
|
|
|
37
37
|
when it's placed in these exact absolute locations.
|
|
38
38
|
|
|
39
39
|
Note: this commandline interface is not compatible with `hypc` provided by the Hyperion compiler package and thus cannot be
|
|
40
|
-
used in combination with
|
|
40
|
+
used in combination with a QRL client via the `qrl.compile.hyperion()` RPC method. Please refer to the
|
|
41
41
|
[Hyperion compiler documentation](https://theqrl.org/) for instructions to install `hypc`.
|
|
42
42
|
Furthermore, the commandline interface to hypc-js provides fewer features than the binary release.
|
|
43
43
|
|
|
@@ -91,7 +91,7 @@ for (var contractName in output.contracts['test.hyp']) {
|
|
|
91
91
|
console.log(
|
|
92
92
|
contractName +
|
|
93
93
|
': ' +
|
|
94
|
-
output.contracts['test.hyp'][contractName].
|
|
94
|
+
output.contracts['test.hyp'][contractName].qrvm.bytecode.object
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
```
|
|
@@ -136,7 +136,7 @@ for (var contractName in output.contracts['test.hyp']) {
|
|
|
136
136
|
console.log(
|
|
137
137
|
contractName +
|
|
138
138
|
': ' +
|
|
139
|
-
output.contracts['test.hyp'][contractName].
|
|
139
|
+
output.contracts['test.hyp'][contractName].qrvm.bytecode.object
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
142
|
```
|
|
@@ -266,7 +266,7 @@ The `linkBytecode` method provides a simple helper for linking:
|
|
|
266
266
|
```javascript
|
|
267
267
|
var linker = require('@theqrl/hypc/linker');
|
|
268
268
|
|
|
269
|
-
bytecode = linker.linkBytecode(bytecode, { MyLibrary: '
|
|
269
|
+
bytecode = linker.linkBytecode(bytecode, { MyLibrary: 'Q123456...' });
|
|
270
270
|
```
|
|
271
271
|
|
|
272
272
|
As of Hyperion 0.4.11 the compiler supports [standard JSON input and output](https://theqrl.org) which outputs a _link references_ map. This gives a map of library names to offsets in the bytecode to replace the addresses at. It also doesn't have the limitation on library file and contract name lengths.
|
package/build/clean.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const distFolder = path.join(__dirname, 'dist');
|
|
4
|
-
|
|
5
|
-
fs.rmdirSync(distFolder);
|
|
6
|
-
}
|
|
3
|
+
const distFolder = path.join(__dirname, '../dist');
|
|
4
|
+
fs.rmSync(distFolder, { recursive: true, force: true });
|
package/hypc.js
CHANGED
|
@@ -203,7 +203,7 @@ const cliInput = {
|
|
|
203
203
|
},
|
|
204
204
|
outputSelection: {
|
|
205
205
|
'*': {
|
|
206
|
-
'*': ['abi', '
|
|
206
|
+
'*': ['abi', 'qrvm.bytecode']
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
},
|
|
@@ -243,7 +243,7 @@ for (const fileName in output.contracts) {
|
|
|
243
243
|
let contractFileName = fileName + ':' + contractName;
|
|
244
244
|
contractFileName = contractFileName.replace(/[:./\\]/g, '_');
|
|
245
245
|
if (options.bin) {
|
|
246
|
-
writeFile(contractFileName + '.bin', output.contracts[fileName][contractName].
|
|
246
|
+
writeFile(contractFileName + '.bin', output.contracts[fileName][contractName].qrvm.bytecode.object);
|
|
247
247
|
}
|
|
248
248
|
if (options.abi) {
|
|
249
249
|
writeFile(contractFileName + '.abi', toFormattedJson(output.contracts[fileName][contractName].abi));
|