Skip to content

Commit

Permalink
New config issue format (#166)
Browse files Browse the repository at this point in the history
* Convert test case configs to new format

* Modify test case config checker

* Update json_lint checker

* Resolve issue with checkers

* Update circle ci config

* Check config hash

* Fix hash in runtime_user_input_call config

* Update image version

* Update checker

* Change the way web3 was used

* Generate config bytecode hash by runtime bytecode

* Remove line break. And append all line numbers

* Check if solidity file exists

* add bytecode offset at SUB opcode

* Add offset add SUB opcode

* Add bytecode offset at SUB

* Add offset at MUL

* Add offset at ADD opcode

* Correct offset

* Add offset at SSTORE

* Add offset at JUMP

* fix byte code loc to reference creation bytecode

* Check create and runtime bytecode of all contracts within json files

* Display errors in configs in readble format

* Update yaml schema linter

* YAML schema validation

* Rewrite bash script of yaml schema validation to js

* bytecode offset at opcode 0xfe in ConstructorCreate

* Update offset to opcode 0xfe 

and ConstructorCreateArgument

* Update offset to opcode 0xfe

* #168 Change folder structure

* Update Circle CI Docker image

* #168 GitHub checker for folder structure

* #168 Update circle ci task name

* #168 Update circle ci move task to flow

* #168 Update circle ci image and yaml content validator
  • Loading branch information
s0b0lev authored and thec00n committed Feb 14, 2019
1 parent 6565d00 commit 8a3878f
Show file tree
Hide file tree
Showing 418 changed files with 4,432 additions and 946 deletions.
18 changes: 17 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
name: Validate JSON files
shell: /bin/sh
command: |
cd scripts/ && npm install jsonlint && npm run json-lint
cd scripts/ && npm install && npm run json-lint
swc-yaml-config-content:
<<: *defaults
Expand All @@ -64,6 +64,16 @@ jobs:
command: |
cd scripts/ && npm install && npm run yaml-content-validate
swc-folder-structure:
<<: *defaults
steps:
- checkout
- run:
name: Check folder structure
shell: /bin/sh
command: |
cd scripts/ && npm install && npm run validate-dirs
deploy-gh-pages:
<<: *defaults
steps:
Expand Down Expand Up @@ -108,6 +118,12 @@ workflows:
- gh-pages
- website
- swc-json-lint:
filters:
branches:
ignore:
- gh-pages
- website
- swc-folder-structure:
filters:
branches:
ignore:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*~
.DS_Store
node_modules/
.vscode/
7 changes: 7 additions & 0 deletions scripts/bash/json_lint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
find ../test_cases -name '*.json' -print | while read line; do
command=$(./node_modules/jsonlint/lib/cli.js $line > /dev/null)
if (($? > 0)); then
echo "ERROR: Wrong json object - $line"
exit 1
fi
done
17 changes: 0 additions & 17 deletions scripts/bash/yaml_schema_lint.sh

This file was deleted.

35 changes: 35 additions & 0 deletions scripts/dir_structure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const fs = require('fs');
const path = require('path');

const walkSync = (dir, filelist=[]) => {
fs.readdirSync(dir).forEach((file) => {
if(fs.statSync(path.join(dir, file)).isDirectory()) {
filelist = walkSync(path.join(dir, file), filelist)
} else {
filelist = filelist.concat(path.join(dir, file));
}
});
return filelist;
};

let hasError = false;

const files = walkSync('../test_cases');

files.map(file => {
const splitedPath = file.split('/');

const [filepath, folder, ...rest] = splitedPath.reverse();
const [filename, ...restels] = filepath.split('.');

if (folder !== filename) {
hasError = true;
console.log(`Path is wrong: ${file}`);
}
});

if (hasError) {
process.exit(1);
} else {
process.exit(0);
}
Loading

0 comments on commit 8a3878f

Please sign in to comment.