aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-09 22:57:51 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-09 22:57:51 +0800
commit22547f419b09f49aac3ef81bb6af1db81f495fad (patch)
tree55f3794625384e74973adfc9488bb63d5f2ca238
parente74f03b087ab811f76b7aff1452cc2cadd680358 (diff)
downloaddexon-sol-tools-22547f419b09f49aac3ef81bb6af1db81f495fad.tar
dexon-sol-tools-22547f419b09f49aac3ef81bb6af1db81f495fad.tar.gz
dexon-sol-tools-22547f419b09f49aac3ef81bb6af1db81f495fad.tar.bz2
dexon-sol-tools-22547f419b09f49aac3ef81bb6af1db81f495fad.tar.lz
dexon-sol-tools-22547f419b09f49aac3ef81bb6af1db81f495fad.tar.xz
dexon-sol-tools-22547f419b09f49aac3ef81bb6af1db81f495fad.tar.zst
dexon-sol-tools-22547f419b09f49aac3ef81bb6af1db81f495fad.zip
Add tests for fillOrderRequests schema
-rw-r--r--test/schema_test.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/schema_test.ts b/test/schema_test.ts
index bdafde915..43f6c6d38 100644
--- a/test/schema_test.ts
+++ b/test/schema_test.ts
@@ -11,6 +11,7 @@ import {addressSchema, numberSchema} from '../src/schemas/basic_type_schemas';
import {orderFillOrKillRequestsSchema} from '../src/schemas/order_fill_or_kill_requests_schema';
import {ecSignatureParameterSchema, ecSignatureSchema} from '../src/schemas/ec_signature_schema';
import {orderCancellationRequestsSchema} from '../src/schemas/order_cancel_schema';
+import {orderFillRequestsSchema} from '../src/schemas/order_fill_requests_schema';
chai.config.includeStack = true;
const expect = chai.expect;
@@ -237,6 +238,31 @@ describe('Schema', () => {
validateAgainstSchema(testCases, orderCancellationRequestsSchema, true);
});
});
+ describe('#orderFillRequestsSchema', () => {
+ const orderFillRequests = [
+ {
+ signedOrder,
+ takerTokenCancelAmount: 5,
+ },
+ ];
+ it('should validate valid order fill requests', () => {
+ const testCases = [
+ orderFillRequests,
+ ];
+ validateAgainstSchema(testCases, orderFillRequestsSchema);
+ });
+ it('should fail for invalid order fill requests', () => {
+ const testCases = [
+ [
+ {
+ ...orderFillRequests[0],
+ takerTokenFillAmount: undefined,
+ },
+ ],
+ ];
+ validateAgainstSchema(testCases, orderFillRequestsSchema, true);
+ });
+ });
});
});
describe('BigNumber serialization', () => {