From 28ccaf0bbd9d02cb63095da08feedd927021622d Mon Sep 17 00:00:00 2001 From: cdetrio Date: Mon, 7 Aug 2017 19:48:31 -0400 Subject: add storage and code restrictions to json schema --- JSONSchema/schema.json | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'JSONSchema/schema.json') diff --git a/JSONSchema/schema.json b/JSONSchema/schema.json index ef08eef1b..7b1536dae 100644 --- a/JSONSchema/schema.json +++ b/JSONSchema/schema.json @@ -5,10 +5,12 @@ "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" }, @@ -91,9 +93,18 @@ "additionalproperties": true, "properties": { "balance": { "$ref": "#/definitions/ConfusedHexType" }, - "code": { "type": "string" }, + "code": { "$ref": "#/definitions/HexMaybePrefixOrEmpty" }, "nonce": { "$ref": "#/definitions/ConfusedHexType" }, - "storage": { "type": "object" } + "storage": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^0x[0-9a-f]+": { + "description": "storage key with 0x. data is HexData", + "$ref": "#/definitions/HexData" + } + } + } }, "required": [ "balance", -- cgit