From 3d259bcfbaa050e1bed5362c94f7058320855153 Mon Sep 17 00:00:00 2001 From: mj52951 Date: Fri, 29 Sep 2023 13:05:49 +0200 Subject: [PATCH] Added validations --- README.md | 2 +- schema.json | 28 +++++++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 81ef74b..8b5317c 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Format of shared domains configuration for all Sygma services: - domains - array of domains that the bridge is supporting - id - domain id - name - domain name - - type - domain type (supstrate, evm) + - type - domain type (substrate, evm) - bridgeContract - address of the bridge contract - handlers - information about the type and address of the handlers contracts - type - handler type (erc20, erc721, permissionedGeneric, permissionlessGeneric) diff --git a/schema.json b/schema.json index 498e998..d901c8e 100644 --- a/schema.json +++ b/schema.json @@ -15,10 +15,15 @@ "type": "string" }, "type": { - "type": "string" + "type": "string", + "enum": [ + "evm", + "substrate" + ] }, "bridge": { - "type": "string" + "type": "string", + "pattern": "^$|^0x[a-fA-F0-9]{40}$" }, "nativeTokenSymbol": { "type": "string" @@ -63,7 +68,8 @@ ] }, "feeRouter": { - "type": "string" + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" }, "feeHandlers": { "type": "array", @@ -72,10 +78,16 @@ "type": "object", "properties": { "address": { - "type": "string" + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" }, "type": { - "type": "string" + "type": "string", + "enum": [ + "basic", + "oracle", + "percentage" + ] } }, "required": [ @@ -92,7 +104,8 @@ "type": "object", "properties": { "resourceId": { - "type": "string" + "type": "string", + "pattern": "^0x[0-9]{64}$" }, "type": { "type": "string", @@ -104,7 +117,8 @@ ] }, "address": { - "type": "string" + "type": "string", + "pattern": "^$|^0x[a-fA-F0-9]{40}$" }, "symbol": { "type": "string"