Browse Source

fixed hexdump problem

ignazio 3 years ago
parent
commit
60944ba73c
2 changed files with 10 additions and 5 deletions
  1. 5 0
      tests/network-tests/index.js
  2. 5 5
      tests/network-tests/run-migration-tests.sh

+ 5 - 0
tests/network-tests/index.js

@@ -11,6 +11,7 @@ const execSync = require('child_process').execSync;
 
 // paths
 const schemaPath = path.join(process.env.DATA_PATH, 'schema.json');
+const wasmPath = path.join(process.env.DATA_PATH, 'runtime.wasm');
 const hexPath = path.join(process.env.DATA_PATH, 'runtime.hex');
 const specPath = path.join(process.env.DATA_PATH, 'chain-spec-raw.json');
 const storagePath = path.join(process.env.DATA_PATH, 'storage.json');
@@ -41,6 +42,10 @@ async function fixParachinStates (api, forkedSpec) {
 }
 
 async function main() {
+
+    // hexdump of runtime wasm binary
+    execSync('cat ' + wasmPath + ' | hexdump -ve \'/1 "%02x"\' > ' + hexPath);
+    
     let api;
     console.log(chalk.green('We are intentionally using the HTTP endpoint. If you see any warnings about that, please ignore them.'));
     if (!fs.existsSync(schemaPath)) {

+ 5 - 5
tests/network-tests/run-migration-tests.sh

@@ -117,19 +117,19 @@ source ./.env
 function fork_off_init() {
     # chain-spec-raw already existing
     
-    if [[ -z ${DATA_PATH}/storage.json ]]; then
-	sudo scp ignazio@testnet-rpc-3-uk.joystream.org:/home/ignazio/storage.json \
-	     ${DATA_PATH}/storage.json
+    if ! [[ -f "$(pwd)/storage.json" ]]; then
+	scp ignazio@testnet-rpc-3-uk.joystream.org:/home/ignazio/storage.json ./storage.json
+	cp ./storage.json ${DATA_PATH}/storage.json
     fi
     
-    if [[ -z ${DATA_PATH}/schema.json ]]; then
+    if ! [[ -f ${DATA_PATH}/schema.json ]]; then
 	cp ../../types/augment/all/defs.json \
 	     ${DATA_PATH}/schema.json
     fi
 
     id=$(docker create joystream/node:${TARGET_RUNTIME_TAG})
     docker cp $id:/joystream/runtime.compact.wasm ${DATA_PATH}/runtime.wasm
-    cat ${DATA_PATH}/runtime.wasm | hexdump -ve \'/1 "%02x"\ > ${DATA_PATH}/runtime.hex
+#    cat ${DATA_PATH}/runtime.wasm | hexdump -ve '/1 "%02x"\' > ${DATA_PATH}/runtime.hex
     
     npm start
 }