Add unit test for prepareOrder and fix bugs

This commit is contained in:
Chris Clark
2015-06-08 13:28:03 -07:00
parent 87b6c09de3
commit a114bf42c4
13 changed files with 99 additions and 56 deletions

View File

@@ -32,7 +32,7 @@ function loadSchemas(dir) {
function formatSchemaError(error) {
return error.field + ' ' + error.message
+ (error.value ? ' (' + error.value + ')' : '');
+ (error.value ? ' (' + JSON.stringify(error.value) + ')' : '');
}
function formatSchemaErrors(errors) {
@@ -42,7 +42,7 @@ function formatSchemaErrors(errors) {
function schemaValidate(schemaName, object) {
const formats = {address: isValidAddress,
ledgerHash: isValidLedgerHash};
const options = {schema: SCHEMAS, formats: formats,
const options = {schemas: SCHEMAS, formats: formats,
verbose: true, greedy: true};
const schema = SCHEMAS[schemaName];
if (schema === undefined) {