Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Unit test for signature transaction - Subtask #456 #804

Merged
merged 27 commits into from
Oct 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c3e24f8
Added basic tests for signature tranasction
Aug 17, 2017
3517f8c
Updated signature logic tests
Aug 21, 2017
16c155a
Replaced usage of scope.schema useage
Aug 21, 2017
02dfabb
Updated test description
Aug 22, 2017
cb6c1ed
Fixed description, format of tests and added tests
Sep 20, 2017
5590d49
Merge branch '1.0.0' into 456-unit-test-for-signature-transaction
Sep 26, 2017
25c6883
Merge branch '1.0.0' into 456-unit-test-for-signature-transaction
Sep 26, 2017
0e78fcc
Refactored dynamic tests for signature.publicKey
Sep 26, 2017
c8d1023
Merge branch '1.0.0' into 456-unit-test-for-signature-transaction
diego-G Sep 28, 2017
139a960
Added signature test to run when unit tests are run
Sep 29, 2017
f06c8a8
Refactored structure of tests
Sep 29, 2017
698a049
Merge branch '456-unit-test-for-signature-transaction' of github.com:…
Sep 29, 2017
30a5d6d
Merge branch '1.0.0' into 456-unit-test-for-signature-transaction
Oct 2, 2017
a1ede26
Merge branch '1.0.0' into 456-unit-test-for-signature-transaction
Oct 2, 2017
9cf17f7
Refactored tests to new standard for signature trs
Oct 2, 2017
0cd51dd
Merge branch '456-unit-test-for-signature-transaction' of github.com:…
Oct 5, 2017
83727b5
Added basic tests for signature tranasction
Aug 17, 2017
fcfeb36
Updated signature logic tests
Aug 21, 2017
6962901
Replaced usage of scope.schema useage
Aug 21, 2017
fe6057d
Updated test description
Aug 22, 2017
b092631
Fixed description, format of tests and added tests
Sep 20, 2017
6162f6d
Refactored dynamic tests for signature.publicKey
Sep 26, 2017
0d7bdaf
Added signature test to run when unit tests are run
Sep 29, 2017
70e9013
Refactored structure of tests
Sep 29, 2017
e297d1c
Refactored tests to new standard for signature trs
Oct 2, 2017
36cce9a
Resovlved issue with some tests
Oct 5, 2017
ed46587
Apply skeleton schema rules to signature tests
MaciejBaj Oct 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion logic/signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Signature.prototype.objectNormalize = function (trs) {
var report = library.schema.validate(trs.asset.signature, Signature.prototype.schema);

if (!report) {
throw 'Failed to validate signature schema: ' + this.scope.schema.getLastErrors().map(function (err) {
throw 'Failed to validate signature schema: ' + library.schema.getLastErrors().map(function (err) {
return err.message;
}).join(', ');
}
Expand Down
21 changes: 14 additions & 7 deletions test/common/typesRepresentatives.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,7 @@ var others = [
}
];

var strings = [
{
input: '',
description: 'empty string',
expectation: 'string'
},
var nonEmptyStrings = [
{
input: '0',
description: '0 as string',
Expand Down Expand Up @@ -147,6 +142,16 @@ var strings = [
}
];

var emptyString = [
{
input: '',
description: 'empty string',
expectation: 'string'
}
];

var strings = nonEmptyStrings.concat(emptyString);

var allTypes = arrays
.concat(booleans)
.concat(positiveIntegers)
Expand All @@ -167,5 +172,7 @@ module.exports = {
negativeNumbers: negativeNumbers,
objects: objects,
others: others,
strings: strings
strings: strings,
nonEmptyStrings: nonEmptyStrings,
emptyString: emptyString
};
1 change: 1 addition & 0 deletions test/unit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require('./logic/peers');
require('./logic/multisignature');
require('./logic/transaction');
require('./logic/transfer');
require('./logic/signature.js');
require('./logic/vote');

require('./modules/blocks/process');
Expand Down
Loading