aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--JSONSchema/filler-schema.json257
2 files changed, 258 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index a2b9a2757..d9d7c58fb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,3 +12,4 @@ script:
- 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 -e "$(find GeneralStateTests -name '*.json')" | node JSONSchema/validate.js JSONSchema/schema.json
+- echo -e "$(find src/GeneralStateTestsFiller -name '*.json')" | node JSONSchema/validate.js JSONSchema/filler-schema.json \ No newline at end of file
diff --git a/JSONSchema/filler-schema.json b/JSONSchema/filler-schema.json
new file mode 100644
index 000000000..07731f7b9
--- /dev/null
+++ b/JSONSchema/filler-schema.json
@@ -0,0 +1,257 @@
+{
+ "definitions": {
+ "EmptyString": {
+ "type": "string",
+ "pattern": "^$"
+ },
+ "HexData": {
+ "pattern": "^0x([0-9a-fA-F][0-9a-fA-F])*$",
+ "type": "string"
+ },
+ "HexQuantity": {
+ "pattern": "(^0x0$)|(^0x[1-9a-fA-F][0-9a-fA-F]*$)",
+ "type": "string"
+ },
+ "ConfusedHexType": {
+ "anyOf": [
+ { "$ref": "#/definitions/HexData" },
+ { "$ref": "#/definitions/HexQuantity" }
+ ]
+ },
+ "HexDataOrEmpty": {
+ "oneOf": [
+ { "$ref": "#/definitions/HexData" },
+ { "$ref": "#/definitions/EmptyString" }
+ ]
+ },
+ "HexNoPrefix" : {
+ "pattern": "^([0-9a-fA-F][0-9a-fA-F])+$",
+ "type": "string"
+ },
+ "HexMaybePrefix": {
+ "oneOf": [
+ { "$ref": "#/definitions/HexNoPrefix" },
+ { "$ref": "#/definitions/HexData" }
+ ]
+ },
+ "HexMaybePrefixOrEmpty": {
+ "oneOf": [
+ { "$ref": "#/definitions/HexMaybePrefix" },
+ { "$ref": "#/definitions/EmptyString" }
+ ]
+ },
+ "IntegerString": {
+ "pattern": "^[0-9]+$",
+ "type": "string"
+ },
+ "IntegerOrEmpty": {
+ "oneOf": [
+ { "$ref": "#/definitions/IntegerString" },
+ { "$ref": "#/definitions/EmptyString" }
+ ]
+ },
+ "IntegerOrNumber": {
+ "oneOf": [
+ { "$ref": "#/definitions/IntegerString" },
+ { "type": "number" }
+ ]
+ },
+ "IntegerOrNumberOrConfusedHex": {
+ "oneOf": [
+ { "$ref": "#/definitions/IntegerOrNumber" },
+ { "$ref": "#/definitions/ConfusedHexType" }
+ ]
+ },
+ "IntegerOrEmptyOrHexQuantity": {
+ "oneOf": [
+ { "$ref": "#/definitions/IntegerOrEmpty" },
+ { "$ref": "#/definitions/HexQuantity" }
+ ]
+ },
+ "IntegerOrHexQuantity": {
+ "oneOf": [
+ { "$ref": "#/definitions/IntegerString" },
+ { "$ref": "#/definitions/HexQuantity" }
+ ]
+ },
+ "IntegerOrConfusedHex": {
+ "anyOf": [
+ { "$ref": "#/definitions/IntegerString" },
+ { "$ref": "#/definitions/ConfusedHexType" }
+ ]
+ },
+ "IntegerOrEmptyOrConfusedHex": {
+ "oneOf": [
+ { "$ref": "#/definitions/IntegerOrEmpty" },
+ { "$ref": "#/definitions/ConfusedHexType" }
+ ]
+ },
+ "PreStateAccount": {
+ "type": "object",
+ "additionalproperties": true,
+ "properties": {
+ "balance": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "code": { "type": "string" },
+ "nonce": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "storage": { "type": "object" }
+ },
+ "required": [
+ "balance",
+ "code",
+ "nonce"
+ ]
+ },
+ "TxSigR": {
+ "oneOf": [
+ { "enum" : [ "0" ] }
+ ]
+ },
+ "TxSigS": {
+ "oneOf": [
+ { "enum" : [ "0" ] }
+ ]
+ },
+ "TxSigV": {
+ "description": "a value of 0 is an invalid chainId, but used in a test case",
+ "oneOf": [
+ { "enum" : [ "0", "1" ] }
+ ]
+ },
+ "HexLen40": {
+ "pattern": "^0x[0-9a-fA-F]{40}$",
+ "type": "string"
+ },
+ "HexNoPrefixLen40": {
+ "pattern": "^[0-9a-fA-F]{40}$",
+ "type": "string"
+ },
+ "AddressMaybePrefixOrEmpty" : {
+ "oneOf": [
+ { "$ref": "#/definitions/HexLen40" },
+ { "$ref": "#/definitions/HexNoPrefixLen40" },
+ { "$ref": "#/definitions/EmptyString" }
+ ]
+ },
+ "Transaction": {
+ "type": "object",
+ "additionalProperties": true,
+ "not": {
+ "required": ["r, s, v"]
+ },
+ "properties": {
+ "data": {
+ "items": { "$ref": "#/definitions/HexDataOrEmpty" },
+ "type": "array"
+ },
+ "gasLimit": {
+ "items": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "type": "array"
+ },
+ "gasPrice": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "nonce": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "secretKey": { "$ref": "#/definitions/HexMaybePrefix" },
+ "to": { "$ref": "#/definitions/AddressMaybePrefixOrEmpty"},
+ "value": {
+ "items": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "type": "array"
+ }
+ },
+ "required": [
+ "data",
+ "gasLimit",
+ "gasPrice",
+ "nonce",
+ "secretKey",
+ "to",
+ "value"
+ ]
+ },
+ "NullSenderTransaction": {
+ "type": "object",
+ "additionalProperties": true,
+ "not": {
+ "required": ["secretKey"]
+ },
+ "properties": {
+ "data": {
+ "items": { "$ref": "#/definitions/HexMaybePrefixOrEmpty" },
+ "type": "array"
+ },
+ "gasLimit": {
+ "items": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "type": "array"
+ },
+ "gasPrice": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "nonce": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "r": { "$ref": "#/definitions/TxSigR" },
+ "s": { "$ref": "#/definitions/TxSigS" },
+ "to": { "$ref": "#/definitions/AddressMaybePrefixOrEmpty"},
+ "v": { "$ref": "#/definitions/TxSigV" },
+ "value": {
+ "items": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" },
+ "type": "array"
+ }
+ },
+ "required": [
+ "data",
+ "gasLimit",
+ "gasPrice",
+ "nonce",
+ "r",
+ "s",
+ "v",
+ "to",
+ "value"
+ ]
+ }
+ },
+ "patternProperties": {
+ "^.*$": {
+ "properties": {
+ "env": {
+ "additionalproperties": false,
+ "properties": {
+ "currentCoinbase": { "$ref": "#/definitions/HexMaybePrefix" },
+ "currentDifficulty": { "$ref": "#/definitions/IntegerOrConfusedHex" },
+ "currentGasLimit": { "$ref": "#/definitions/IntegerOrConfusedHex" },
+ "currentNumber": { "$ref": "#/definitions/IntegerOrConfusedHex" },
+ "currentTimestamp": { "$ref": "#/definitions/IntegerOrNumberOrConfusedHex" },
+ "previousHash": { "$ref": "#/definitions/HexMaybePrefix" }
+ },
+ "required": [
+ "currentCoinbase",
+ "currentDifficulty",
+ "currentGasLimit",
+ "currentNumber",
+ "currentTimestamp",
+ "previousHash"
+ ],
+ "type": "object"
+ },
+ "expect": {},
+ "pre": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^[0-9a-fA-F]{40}": {
+ "description": "filler prestate addresses without 0x prefix",
+ "$ref": "#/definitions/PreStateAccount"
+ },
+ "^0x[0-9a-fA-F]{40}": {
+ "description": "filler prestate addresses with 0x prefix",
+ "$ref": "#/definitions/PreStateAccount"
+ }
+ },
+ "type": "object"
+ },
+ "transaction": {
+ "oneOf": [
+ { "$ref": "#/definitions/Transaction" },
+ { "$ref": "#/definitions/NullSenderTransaction" }
+ ]
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+}