aboutsummaryrefslogtreecommitdiffstats
path: root/packages/json-schemas/test
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-12-06 20:52:22 +0800
committerGitHub <noreply@github.com>2017-12-06 20:52:22 +0800
commit594bd2de1ccb41e34729834d67eba617baf1aa80 (patch)
treeb623eb0ed7698b2f0076871fa8bd2bb12298c5c7 /packages/json-schemas/test
parent55083316fc7f4bcfbb77470a3f66e621a68ebb95 (diff)
parentf0c27f98b809afda3c750e77dbd3f35ccd29ec01 (diff)
downloaddexon-sol-tools-594bd2de1ccb41e34729834d67eba617baf1aa80.tar
dexon-sol-tools-594bd2de1ccb41e34729834d67eba617baf1aa80.tar.gz
dexon-sol-tools-594bd2de1ccb41e34729834d67eba617baf1aa80.tar.bz2
dexon-sol-tools-594bd2de1ccb41e34729834d67eba617baf1aa80.tar.lz
dexon-sol-tools-594bd2de1ccb41e34729834d67eba617baf1aa80.tar.xz
dexon-sol-tools-594bd2de1ccb41e34729834d67eba617baf1aa80.tar.zst
dexon-sol-tools-594bd2de1ccb41e34729834d67eba617baf1aa80.zip
Merge branch 'development' into feature/airport-experiments
Diffstat (limited to 'packages/json-schemas/test')
-rw-r--r--packages/json-schemas/test/schema_test.ts43
1 files changed, 33 insertions, 10 deletions
diff --git a/packages/json-schemas/test/schema_test.ts b/packages/json-schemas/test/schema_test.ts
index 653f70852..758ccac61 100644
--- a/packages/json-schemas/test/schema_test.ts
+++ b/packages/json-schemas/test/schema_test.ts
@@ -432,6 +432,7 @@ describe('Schema', () => {
{
type: 'subscribe',
channel: 'orderbook',
+ requestId: 1,
payload: {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
quoteTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
@@ -442,6 +443,7 @@ describe('Schema', () => {
{
type: 'subscribe',
channel: 'orderbook',
+ requestId: 1,
payload: {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
quoteTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
@@ -454,8 +456,19 @@ describe('Schema', () => {
const checksummedAddress = '0xA2b31daCf30a9C50ca473337c01d8A201ae33e32';
const testCases = [
{
+ type: 'subscribe',
+ channel: 'orderbook',
+ payload: {
+ baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
+ quoteTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
+ snapshot: true,
+ limit: 100,
+ },
+ },
+ {
type: 'foo',
channel: 'orderbook',
+ requestId: 1,
payload: {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
quoteTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
@@ -464,6 +477,7 @@ describe('Schema', () => {
{
type: 'subscribe',
channel: 'bar',
+ requestId: 1,
payload: {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
quoteTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
@@ -472,6 +486,7 @@ describe('Schema', () => {
{
type: 'subscribe',
channel: 'orderbook',
+ requestId: 1,
payload: {
baseTokenAddress: checksummedAddress,
quoteTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
@@ -480,6 +495,7 @@ describe('Schema', () => {
{
type: 'subscribe',
channel: 'orderbook',
+ requestId: 1,
payload: {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
quoteTokenAddress: checksummedAddress,
@@ -488,6 +504,7 @@ describe('Schema', () => {
{
type: 'subscribe',
channel: 'orderbook',
+ requestId: 1,
payload: {
quoteTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
},
@@ -495,6 +512,7 @@ describe('Schema', () => {
{
type: 'subscribe',
channel: 'orderbook',
+ requestId: 1,
payload: {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
},
@@ -502,6 +520,7 @@ describe('Schema', () => {
{
type: 'subscribe',
channel: 'orderbook',
+ requestId: 1,
payload: {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
quoteTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
@@ -512,6 +531,7 @@ describe('Schema', () => {
{
type: 'subscribe',
channel: 'orderbook',
+ requestId: 1,
payload: {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
quoteTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
@@ -530,7 +550,7 @@ describe('Schema', () => {
{
type: 'snapshot',
channel: 'orderbook',
- channelId: 2,
+ requestId: 2,
payload: {
bids: [],
asks: [],
@@ -539,7 +559,7 @@ describe('Schema', () => {
{
type: 'snapshot',
channel: 'orderbook',
- channelId: 2,
+ requestId: 2,
payload: {
bids: [
signedOrder,
@@ -557,7 +577,7 @@ describe('Schema', () => {
{
type: 'foo',
channel: 'orderbook',
- channelId: 2,
+ requestId: 2,
payload: {
bids: [
signedOrder,
@@ -570,7 +590,7 @@ describe('Schema', () => {
{
type: 'snapshot',
channel: 'bar',
- channelId: 2,
+ requestId: 2,
payload: {
bids: [
signedOrder,
@@ -595,7 +615,7 @@ describe('Schema', () => {
{
type: 'snapshot',
channel: 'orderbook',
- channelId: '2',
+ requestId: '2',
payload: {
bids: [
signedOrder,
@@ -608,7 +628,7 @@ describe('Schema', () => {
{
type: 'snapshot',
channel: 'orderbook',
- channelId: 2,
+ requestId: 2,
payload: {
bids: [
signedOrder,
@@ -618,7 +638,7 @@ describe('Schema', () => {
{
type: 'snapshot',
channel: 'orderbook',
- channelId: 2,
+ requestId: 2,
payload: {
asks: [
signedOrder,
@@ -628,7 +648,7 @@ describe('Schema', () => {
{
type: 'snapshot',
channel: 'orderbook',
- channelId: 2,
+ requestId: 2,
payload: {
bids: [
signedOrder,
@@ -641,7 +661,7 @@ describe('Schema', () => {
{
type: 'snapshot',
channel: 'orderbook',
- channelId: 2,
+ requestId: 2,
payload: {
bids: [
{},
@@ -662,7 +682,7 @@ describe('Schema', () => {
{
type: 'update',
channel: 'orderbook',
- channelId: 2,
+ requestId: 2,
payload: signedOrder,
},
];
@@ -673,16 +693,19 @@ describe('Schema', () => {
{
type: 'foo',
channel: 'orderbook',
+ requestId: 2,
payload: signedOrder,
},
{
type: 'update',
channel: 'bar',
+ requestId: 2,
payload: signedOrder,
},
{
type: 'update',
channel: 'orderbook',
+ requestId: 2,
payload: {},
},
];