aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml9
-rw-r--r--JSONSchema/schema.json12
-rwxr-xr-xJSONSchema/validate.js2
3 files changed, 15 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index 24267e38a..9aad47f7a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,11 +1,14 @@
language: python
-python: 2.7
+python:
+ - "2.7"
+node_js:
+ - "7"
sudo: false
-install: "pip install jsonschema"
+install: "npm install jsonschema"
script:
# won't fail, but print problems
- find . -name "*.json" -not -name "*Filler.json" -exec echo {} \; -exec python -mjson.tool {} /dev/null \; 2>&1 | grep -v -B 1 "^\./" | cat
# will fail, if linting fails
- find . -name "*.json" -not -name "*Filler.json" -print0 | xargs -I file -n1 -0 python -mjson.tool file /dev/null
# run schema tests against GeneralStateTests
-- echo "$(find GeneralStateTests -name '*.json' ! -path '../schema/*.json')" | python JSONSchema/validate.py
+- echo -e "$(find GeneralStateTests -name '*.json' ! -path '../schema/*.json')" | node JSONSchema/validate.js
diff --git a/JSONSchema/schema.json b/JSONSchema/schema.json
index 5ac5e7a71..6e7113950 100644
--- a/JSONSchema/schema.json
+++ b/JSONSchema/schema.json
@@ -22,7 +22,8 @@
"Metropolis": {
"type": "array"
}
- } },
+ }
+ },
"explanation": {
"type": "string"
},
@@ -53,7 +54,8 @@
"type": "string",
"pattern": "^0x[0-9a-f]*$"
}
- }
+ },
+ "additionalproperties": false
},
"pre": {
"type": "object",
@@ -79,7 +81,8 @@
}
}
}
- }
+ },
+ "additionalProperties": false
},
"transaction": {
"type": "object",
@@ -121,7 +124,8 @@
"pattern": "^0x[0-9a-f]*$"
}
}
- }
+ },
+ "additionalProperties": false
}
}
}
diff --git a/JSONSchema/validate.js b/JSONSchema/validate.js
index 368d28da2..6c44b834f 100755
--- a/JSONSchema/validate.js
+++ b/JSONSchema/validate.js
@@ -15,7 +15,7 @@ var rl = readline.createInterface({
});
rl.on('line', function(line){
- fs.readFile('schema.json', function(err, data) {
+ fs.readFile('JSONSchema/schema.json', function(err, data) {
if (err) {
throw err;
}