aboutsummaryrefslogtreecommitdiffstats
path: root/JSONSchema/st-schema.json
diff options
context:
space:
mode:
Diffstat (limited to 'JSONSchema/st-schema.json')
-rw-r--r--JSONSchema/st-schema.json339
1 files changed, 339 insertions, 0 deletions
diff --git a/JSONSchema/st-schema.json b/JSONSchema/st-schema.json
new file mode 100644
index 000000000..7b1536dae
--- /dev/null
+++ b/JSONSchema/st-schema.json
@@ -0,0 +1,339 @@
+{
+ "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" }
+ ]
+ },
+ "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/ConfusedHexType" },
+ "code": { "$ref": "#/definitions/HexMaybePrefixOrEmpty" },
+ "nonce": { "$ref": "#/definitions/ConfusedHexType" },
+ "storage": {
+ "type": "object",
+ "additionalProperties": false,
+ "patternProperties": {
+ "^0x[0-9a-f]+": {
+ "description": "storage key with 0x. data is HexData",
+ "$ref": "#/definitions/HexData"
+ }
+ }
+ }
+ },
+ "required": [
+ "balance",
+ "code",
+ "nonce"
+ ]
+ },
+ "TxSigR": {
+ "oneOf": [
+ { "enum" : [ "0x00" ] }
+ ]
+ },
+ "TxSigS": {
+ "oneOf": [
+ { "enum" : [ "0x00" ] }
+ ]
+ },
+ "TxSigV": {
+ "description": "a value of 0 is an invalid chainId, but used in a test case",
+ "oneOf": [
+ { "enum" : [ "0x00", "0x01" ] }
+ ]
+ },
+ "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"
+ ]
+ },
+ "TransactionResults": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "hash": {
+ "$ref": "#/definitions/HexData"
+ },
+ "logs": {},
+ "indexes": {
+ "additionalProperties": false,
+ "properties": {
+ "data": {
+ "type": "integer"
+ },
+ "gas": {
+ "type": "integer"
+ },
+ "value": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "data",
+ "gas",
+ "value"
+ ],
+ "type": "object"
+ }
+ },
+ "required": [
+ "hash",
+ "indexes"
+ ],
+ "type": "object"
+ },
+ "type": "array"
+ }
+ },
+ "patternProperties": {
+ "^.*$": {
+ "properties": {
+ "env": {
+ "additionalproperties": false,
+ "properties": {
+ "currentCoinbase": {
+ "$ref": "#/definitions/HexData"
+ },
+ "currentDifficulty": {
+ "$ref": "#/definitions/ConfusedHexType"
+ },
+ "currentGasLimit": {
+ "$ref": "#/definitions/ConfusedHexType"
+ },
+ "currentNumber": {
+ "$ref": "#/definitions/ConfusedHexType"
+ },
+ "currentTimestamp": {
+ "$ref": "#/definitions/ConfusedHexType"
+ },
+ "previousHash": {
+ "$ref": "#/definitions/HexData"
+ }
+ },
+ "required": [
+ "currentCoinbase",
+ "currentDifficulty",
+ "currentGasLimit",
+ "currentNumber",
+ "currentTimestamp",
+ "previousHash"
+ ],
+ "type": "object"
+ },
+ "explanation": {
+ "type": "string"
+ },
+ "post": {
+ "additionalProperties": false,
+ "properties": {
+ "EIP150": {
+ "$ref": "#/definitions/TransactionResults"
+ },
+ "EIP158": {
+ "$ref": "#/definitions/TransactionResults"
+ },
+ "Frontier": {
+ "$ref": "#/definitions/TransactionResults"
+ },
+ "Homestead": {
+ "$ref": "#/definitions/TransactionResults"
+ },
+ "Byzantium": {
+ "$ref": "#/definitions/TransactionResults"
+ },
+ "Constantinople": {
+ "$ref": "#/definitions/TransactionResults"
+ }
+ },
+ "type": "object"
+ },
+ "pre": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^0x[0-9a-f]*": {
+ "description": "prestate account address with 0x prefix",
+ "$ref": "#/definitions/PreStateAccount"
+ }
+ },
+ "type": "object"
+ },
+ "transaction": {
+ "oneOf": [
+ { "$ref": "#/definitions/Transaction" },
+ { "$ref": "#/definitions/NullSenderTransaction" }
+ ]
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+}