add unit tests for NotFound

This commit is contained in:
Manuel Araoz 2015-02-02 16:18:10 -03:00
parent 087c57e077
commit cc7b58369b
3 changed files with 7 additions and 2 deletions

View File

@ -147,7 +147,7 @@ Message.prototype.getPayload = function() {
* @returns{Buffer} the serialized message
*/
Message.prototype.serialize = function(network) {
$.checkArgument(network);
$.checkArgument(network, 'Must specify network for serialization');
var commandBuf = new Buffer(this.command, 'ascii');
$.checkState(commandBuf.length <= 12, 'Command name too long');
var magic = network.networkMagic;

View File

@ -11,6 +11,10 @@
"message": "",
"payload": ""
},
"NOTFOUND": {
"message": "f9beb4d96e6f74666f756e6400000000250000001d33d53201010000003a4af715be220eae7b2657582869daddf79ac4afb4a0e1cafa5b57e1afb8dfe2",
"payload": "01010000003a4af715be220eae7b2657582869daddf79ac4afb4a0e1cafa5b57e1afb8dfe2"
},
"GETBLOCKS": {
"message": "",
"payload": ""

View File

@ -27,7 +27,8 @@ describe('Messages', function() {
GetData: 'getdata',
GetAddresses: 'getaddr',
Headers: 'headers',
Transaction: 'tx'
Transaction: 'tx',
NotFound: 'notfound'
};
// TODO: add data for these
var noPayload = ['Alert', 'Reject', 'GetBlocks', 'GetHeaders', 'GetData', 'Headers'];