diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2018-06-01 10:39:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-01 10:39:41 +0800 |
commit | 7c228f70fc055ee48489078331328a18c5455586 (patch) | |
tree | 79d0a60162d5dfa53997f36859e4de035a280bf0 /JSONSchema/st-filler-schema.json | |
parent | 0eef2f31ab59016a7ccad2a99d4644f753eebcb9 (diff) | |
parent | 3dabf27265670f95717ff646841acdfeaccddfb1 (diff) | |
download | tangerine-tests-7c228f70fc055ee48489078331328a18c5455586.tar tangerine-tests-7c228f70fc055ee48489078331328a18c5455586.tar.gz tangerine-tests-7c228f70fc055ee48489078331328a18c5455586.tar.bz2 tangerine-tests-7c228f70fc055ee48489078331328a18c5455586.tar.lz tangerine-tests-7c228f70fc055ee48489078331328a18c5455586.tar.xz tangerine-tests-7c228f70fc055ee48489078331328a18c5455586.tar.zst tangerine-tests-7c228f70fc055ee48489078331328a18c5455586.zip |
Merge pull request #466 from ehildenb/test-validator-script
Test validator script
Diffstat (limited to 'JSONSchema/st-filler-schema.json')
-rw-r--r-- | JSONSchema/st-filler-schema.json | 438 |
1 files changed, 172 insertions, 266 deletions
diff --git a/JSONSchema/st-filler-schema.json b/JSONSchema/st-filler-schema.json index d110e0493..9c810bee1 100644 --- a/JSONSchema/st-filler-schema.json +++ b/JSONSchema/st-filler-schema.json @@ -1,188 +1,55 @@ { "definitions": { - "EmptyString": { - "type": "string", - "pattern": "^$" - }, - "HexData": { - "description": "Hex data. see https://github.com/ethereum/wiki/wiki/JSON-RPC#hex-value-encoding", - "pattern": "^0x([0-9a-fA-F][0-9a-fA-F])*$", - "type": "string" - }, - "HexQuantity": { - "description": "Hex quantity. see https://github.com/ethereum/wiki/wiki/JSON-RPC#hex-value-encoding", - "pattern": "(^0x0$)|(^0x[1-9a-fA-F][0-9a-fA-F]*$)", - "type": "string" - }, - "ConfusedHexType": { - "anyOf": [ - { "$ref": "#/definitions/HexData" }, - { "$ref": "#/definitions/HexQuantity" } - ] - }, - "TxData": { - "oneOf": [ - { "$ref": "#/definitions/HexData" }, - { "$ref": "#/definitions/EmptyString" }, - { "$ref": "#/definitions/LLLCode" } - ] - }, - "LLLCode" : { - "type" : "string", - "pattern" : "^{.*}$" - }, - "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" } - ] - }, - "PrefixedHexOrInteger": { - "anyOf": [ - { "$ref": "#/definitions/IntegerString" }, - { "$ref": "#/definitions/HexData" } - ] - }, - "PreStateAccount": { - "type": "object", - "additionalproperties": true, - "properties": { - "balance": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" }, - "code": { "type": "string" }, - "nonce": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" }, - "storage": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^0x[0-9a-f]+": { - "description": "storage key with 0x prefix, just the prefix `0x` is null and thus not permitted, a hex quantity is permitted. for the storage value, only hex data is permitted in filled test. Both decimal and hex allowed for the fillers.", - "$ref": "#/definitions/PrefixedHexOrInteger" - } - } - } - } - }, - "NonExistentPostStateAccount": { - "type": "object", - "additionalproperties": true, - "properties": { - "shouldnotexist": { - "type": "boolean" + "AccountMap": { + "additionalProperties": false, + "patternProperties": { + "^0x[0-9a-fA-F]{40}": { + "$ref": "#/definitions/PreStateAccount", + "description": "filler prestate addresses with 0x prefix" + }, + "^[0-9a-fA-F]{40}": { + "$ref": "#/definitions/PreStateAccount", + "description": "filler prestate addresses without 0x prefix" } }, - "required": [ - "shouldnotexist" - ] - - }, - "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" } - ] + "type": "object" }, - "Transaction": { - "type": "object", - "additionalProperties": true, - "not": { - "required": ["r, s, v"] - }, + "NullSenderTransaction": { "properties": { "data": { - "items": { "$ref": "#/definitions/TxData" }, + "items": { + "$ref": "#/definitions/TxData" + }, "type": "array" }, "gasLimit": { - "items": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" }, + "items": { + "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" + }, "type": "array" }, - "gasPrice": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" }, - "nonce": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" }, - "secretKey": { "$ref": "#/definitions/HexMaybePrefix" }, - "to": { "$ref": "#/definitions/AddressMaybePrefixOrEmpty"}, + "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" }, + "items": { + "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" + }, "type": "array" } }, @@ -191,34 +58,78 @@ "gasLimit", "gasPrice", "nonce", - "secretKey", + "r", + "s", + "v", "to", "value" - ] + ], + "type": "object" }, - "NullSenderTransaction": { - "type": "object", - "additionalProperties": true, - "not": { - "required": ["secretKey"] + "PreStateAccount": { + "additionalproperties": true, + "properties": { + "balance": { + "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" + }, + "code": { + "type": "string" + }, + "nonce": { + "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" + }, + "storage": { + "additionalProperties": false, + "patternProperties": { + "^0x[0-9a-f]+": { + "$ref": "#/definitions/PrefixedHexOrInteger", + "description": "storage key with 0x prefix, just the prefix `0x` is null and thus not permitted, a hex quantity is permitted. for the storage value, only hex data is permitted in filled test. Both decimal and hex allowed for the fillers." + } + }, + "type": "object" + } }, + "type": "object" + }, + "Transaction": { "properties": { "data": { - "items": { "$ref": "#/definitions/TxData" }, + "items": { + "$ref": "#/definitions/TxData" + }, "type": "array" }, "gasLimit": { - "items": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" }, + "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" }, + "gasPrice": { + "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" + }, + "nonce": { + "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" + }, + "r": { + "$ref": "#/definitions/TxSigR" + }, + "s": { + "$ref": "#/definitions/TxSigS" + }, + "secretKey": { + "$ref": "#/definitions/HexMaybePrefix" + }, + "to": { + "$ref": "#/definitions/AddressMaybePrefixOrEmpty" + }, + "v": { + "$ref": "#/definitions/TxSigV" + }, "value": { - "items": { "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" }, + "items": { + "$ref": "#/definitions/IntegerOrEmptyOrConfusedHex" + }, "type": "array" } }, @@ -227,75 +138,52 @@ "gasLimit", "gasPrice", "nonce", - "r", - "s", - "v", + "secretKey", "to", "value" - ] + ], + "type": "object" }, - "PostStateAccounts": { - "additionalProperties": false, - "patternProperties": { - "^[0-9a-fA-F]{40}": { - "description": "filler prestate addresses without 0x prefix", - "oneOf": [ - {"$ref": "#/definitions/PreStateAccount"}, - {"$ref": "#/NonExistentPostStateAccount"} - ] + "TxData": { + "anyOf": [ + { + "$ref": "#/definitions/HexData" }, - "^0x[0-9a-fA-F]{40}": { - "description": "filler prestate addresses with 0x prefix", - "oneOf": [ - {"$ref": "#/definitions/PreStateAccount"}, - {"$ref": "#/NonExistentPostStateAccount"} - ] + { + "$ref": "#/definitions/EmptyString" + }, + { + "$ref": "#/definitions/LLLCode" } - }, - "type": "object" - }, - "ExpectCondition": { - "type": "object", - "properties": { - "result": { "$ref": "#/definitions/AccountMap" }, - "network": { "$ref": "#/definitions/Networks" }, - "indexes": { - "properties": { - "data": { "$ref": "#/definitions/Indices" }, - "gas": { "$ref": "#/definitions/Indices" }, - "value": { "$ref": "#/definitions/Indices" } - }, - "result": { - "$ref": "#/definitions/PostStateAccounts" - }, - "additionalProperties": false - }, - "//comment": { "type": "string" } - }, - "additionalProperties": false + ] }, - "AccountMap": { - "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" + "TxSigR": { + "oneOf": [ + { + "enum": [ + "0" + ] + } + ] }, - "Networks": { - "type": "array" + "TxSigS": { + "oneOf": [ + { + "enum": [ + "0" + ] + } + ] }, - "Indices": { - "anyOf": [ - { "type": "array" }, - { "type": "string" }, - { "type": "number" } + "TxSigV": { + "description": "a value of 0 is an invalid chainId, but used in a test case", + "oneOf": [ + { + "enum": [ + "0", + "1" + ] + } ] } }, @@ -305,12 +193,24 @@ "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" } + "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", @@ -323,27 +223,33 @@ "type": "object" }, "expect": { - "type": "array", - "items": { "$ref": "#/definitions/ExpectCondition" } + "items": { + "$ref": "#/definitions/ExpectCondition" + }, + "type": "array" }, "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" + "$ref": "#/definitions/PreStateAccount", + "description": "filler prestate addresses with 0x prefix" + }, + "^[0-9a-fA-F]{40}": { + "$ref": "#/definitions/PreStateAccount", + "description": "filler prestate addresses without 0x prefix" } }, "type": "object" }, "transaction": { "oneOf": [ - { "$ref": "#/definitions/Transaction" }, - { "$ref": "#/definitions/NullSenderTransaction" } + { + "$ref": "#/definitions/Transaction" + }, + { + "$ref": "#/definitions/NullSenderTransaction" + } ] } }, @@ -351,4 +257,4 @@ } }, "type": "object" -} +}
\ No newline at end of file |