@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.
Files changed (40) hide show
  1. package/README.md +4 -4
  2. package/build/clean.js +2 -4
  3. package/hypc.js +2 -2
  4. package/hypjson.js +47 -47
  5. package/linker.js +43 -32
  6. package/package.json +4 -4
  7. package/test/cli.js +1 -1
  8. package/test/compiler.js +21 -21
  9. package/test/linker.js +46 -90
  10. package/test/translate.js +2 -2
  11. package/translate.js +3 -3
  12. package/contractA_hyp_A.bin +0 -1
  13. package/contractB_hyp_B.bin +0 -1
  14. package/importA_hyp_C.bin +0 -1
  15. package/importB_hyp_D.bin +0 -1
  16. package/libX_hyp_X.bin +0 -1
  17. package/libY_hyp_Y.bin +0 -1
  18. package/libZ_hyp_Z.bin +0 -1
  19. package/test/resources/fixtureAsmJson.hyp +0 -8
  20. package/test/resources/fixtureAsmJson.output +0 -101
  21. package/test/resources/fixtureIncorrectSource.hyp +0 -1
  22. package/test/resources/fixtureSmoke.hyp +0 -5
  23. package/test/resources/importA.hyp +0 -7
  24. package/test/resources/importB.hyp +0 -5
  25. package/test/resources/importCallback/base/contractA.hyp +0 -8
  26. package/test/resources/importCallback/base/contractB.hyp +0 -6
  27. package/test/resources/importCallback/contractC.hyp +0 -4
  28. package/test/resources/importCallback/includeA/libX.hyp +0 -4
  29. package/test/resources/importCallback/includeA/libY.hyp +0 -6
  30. package/test/resources/importCallback/includeA/utils.hyp +0 -4
  31. package/test/resources/importCallback/includeB/libZ.hyp +0 -4
  32. package/test/resources/smtChecker/loop.hyp +0 -8
  33. package/test/resources/smtChecker/smoke.hyp +0 -5
  34. package/test/resources/smtChecker/smoke_with_engine.hyp +0 -6
  35. package/test/resources/smtChecker/smoke_with_multi_engine.hyp +0 -8
  36. package/test_resources_fixtureSmoke_hyp_C.abi +0 -1
  37. package/test_resources_fixtureSmoke_hyp_C.bin +0 -1
  38. package/test_resources_importA_hyp_C.bin +0 -1
  39. package/test_resources_importB_hyp_D.bin +0 -1
  40. 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 an Zond client via the `zond.compile.hyperion()` RPC method. Please refer to the
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].evm.bytecode.object
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].evm.bytecode.object
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: '0x123456...' });
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
- if (fs.existsSync(distFolder)) {
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', 'zvm.bytecode']
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].zvm.bytecode.object);
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));