add unit tests for NotFound
This commit is contained in:
parent
087c57e077
commit
cc7b58369b
@ -147,7 +147,7 @@ Message.prototype.getPayload = function() {
|
|||||||
* @returns{Buffer} the serialized message
|
* @returns{Buffer} the serialized message
|
||||||
*/
|
*/
|
||||||
Message.prototype.serialize = function(network) {
|
Message.prototype.serialize = function(network) {
|
||||||
$.checkArgument(network);
|
$.checkArgument(network, 'Must specify network for serialization');
|
||||||
var commandBuf = new Buffer(this.command, 'ascii');
|
var commandBuf = new Buffer(this.command, 'ascii');
|
||||||
$.checkState(commandBuf.length <= 12, 'Command name too long');
|
$.checkState(commandBuf.length <= 12, 'Command name too long');
|
||||||
var magic = network.networkMagic;
|
var magic = network.networkMagic;
|
||||||
|
|||||||
@ -11,6 +11,10 @@
|
|||||||
"message": "",
|
"message": "",
|
||||||
"payload": ""
|
"payload": ""
|
||||||
},
|
},
|
||||||
|
"NOTFOUND": {
|
||||||
|
"message": "f9beb4d96e6f74666f756e6400000000250000001d33d53201010000003a4af715be220eae7b2657582869daddf79ac4afb4a0e1cafa5b57e1afb8dfe2",
|
||||||
|
"payload": "01010000003a4af715be220eae7b2657582869daddf79ac4afb4a0e1cafa5b57e1afb8dfe2"
|
||||||
|
},
|
||||||
"GETBLOCKS": {
|
"GETBLOCKS": {
|
||||||
"message": "",
|
"message": "",
|
||||||
"payload": ""
|
"payload": ""
|
||||||
|
|||||||
@ -27,7 +27,8 @@ describe('Messages', function() {
|
|||||||
GetData: 'getdata',
|
GetData: 'getdata',
|
||||||
GetAddresses: 'getaddr',
|
GetAddresses: 'getaddr',
|
||||||
Headers: 'headers',
|
Headers: 'headers',
|
||||||
Transaction: 'tx'
|
Transaction: 'tx',
|
||||||
|
NotFound: 'notfound'
|
||||||
};
|
};
|
||||||
// TODO: add data for these
|
// TODO: add data for these
|
||||||
var noPayload = ['Alert', 'Reject', 'GetBlocks', 'GetHeaders', 'GetData', 'Headers'];
|
var noPayload = ['Alert', 'Reject', 'GetBlocks', 'GetHeaders', 'GetData', 'Headers'];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user