aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 08:35:02 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 08:35:02 +0800
commitea6583d47e786c846c18fb4893847d3271dedbc3 (patch)
tree3a48f2338d5a5a56adda244f974326f010b88250
parent464c16be73bddce1ed675f642937b164f7add9d8 (diff)
downloaddexon-sol-tools-ea6583d47e786c846c18fb4893847d3271dedbc3.tar
dexon-sol-tools-ea6583d47e786c846c18fb4893847d3271dedbc3.tar.gz
dexon-sol-tools-ea6583d47e786c846c18fb4893847d3271dedbc3.tar.bz2
dexon-sol-tools-ea6583d47e786c846c18fb4893847d3271dedbc3.tar.lz
dexon-sol-tools-ea6583d47e786c846c18fb4893847d3271dedbc3.tar.xz
dexon-sol-tools-ea6583d47e786c846c18fb4893847d3271dedbc3.tar.zst
dexon-sol-tools-ea6583d47e786c846c18fb4893847d3271dedbc3.zip
Make all fields of subscriptionOpts schema optional
-rw-r--r--src/schemas/subscription_opts_schema.ts1
-rw-r--r--test/schema_test.ts6
2 files changed, 3 insertions, 4 deletions
diff --git a/src/schemas/subscription_opts_schema.ts b/src/schemas/subscription_opts_schema.ts
index a32ba8fae..0bb44fecf 100644
--- a/src/schemas/subscription_opts_schema.ts
+++ b/src/schemas/subscription_opts_schema.ts
@@ -16,6 +16,5 @@ export const subscriptionOptsSchema = {
fromBlock: {$ref: '/blockParam'},
toBlock: {$ref: '/blockParam'},
},
- required: ['fromBlock', 'toBlock'],
type: 'object',
};
diff --git a/test/schema_test.ts b/test/schema_test.ts
index 3d1d32d9c..c170bebb1 100644
--- a/test/schema_test.ts
+++ b/test/schema_test.ts
@@ -141,14 +141,14 @@ describe('Schema', () => {
it('should validate valid subscription opts', () => {
const testCases = [
{fromBlock: 42, toBlock: 'latest'},
+ {fromBlock: 42},
+ {},
];
validateAgainstSchema(testCases, subscriptionOptsSchema);
});
it('should fail for invalid subscription opts', () => {
const testCases = [
- {},
- {fromBlock: 42},
- {fromBlock: 42, to: 43},
+ {fromBlock: '42'},
];
const shouldFail = true;
validateAgainstSchema(testCases, subscriptionOptsSchema, shouldFail);