aboutsummaryrefslogtreecommitdiffstats
path: root/packages/json-schemas/test/schema_test.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-06 06:18:36 +0800
committerFabio Berger <me@fabioberger.com>2017-12-06 06:18:36 +0800
commit08168c6e7d52711aeb46e27444ba26970e16e244 (patch)
tree40a006de279221009d0ee05d73bfbb74f0a9ea91 /packages/json-schemas/test/schema_test.ts
parentb5030df4e3afe17b4e652b438d655edda79c5f54 (diff)
parent4441d76725af4e83f90eeb373983b600b6903e8e (diff)
downloaddexon-sol-tools-08168c6e7d52711aeb46e27444ba26970e16e244.tar
dexon-sol-tools-08168c6e7d52711aeb46e27444ba26970e16e244.tar.gz
dexon-sol-tools-08168c6e7d52711aeb46e27444ba26970e16e244.tar.bz2
dexon-sol-tools-08168c6e7d52711aeb46e27444ba26970e16e244.tar.lz
dexon-sol-tools-08168c6e7d52711aeb46e27444ba26970e16e244.tar.xz
dexon-sol-tools-08168c6e7d52711aeb46e27444ba26970e16e244.tar.zst
dexon-sol-tools-08168c6e7d52711aeb46e27444ba26970e16e244.zip
Merge branch 'development' into feature/addSubproviders
* development: (50 commits) Add PR number to changelog Address feedback Add requestId to subscription messages and update json-schemas Remove isomorphic-fetch types from contracts package Update README Regenerate files Make it private Change package name Update README Make fileExtension configurable Rename abi-gen to typed-contracts Add docs for typed-contracts Remove TODOs Introduce separate ContextData type and rework it Check ABI is defined Introduce a const for 'contract.mustache' Improve error message Reuse util Fix a typo Introduce a const for 'function' ... # Conflicts: # yarn.lock
Diffstat (limited to 'packages/json-schemas/test/schema_test.ts')
-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: {},
},
];