aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);