From 9208e95e20aa8af66d1d59bf78cf8543bf8e89ab Mon Sep 17 00:00:00 2001 From: Kagami Hiiragi Date: Sun, 18 Jan 2015 13:20:32 +0300 Subject: [PATCH] Remove useless messageEncodings struct --- README.md | 1 - lib/structs.js | 23 ----------------------- test.js | 11 ----------- 3 files changed, 35 deletions(-) diff --git a/README.md b/README.md index d3d8b73..ca41bdd 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ API documentation is available [here](https://bitchan.github.io/bitmessage/docs/ - [x] net_addr - [x] inv_vect - [x] encrypted - - [x] message encodings - [x] service features - [x] pubkey features - [x] Message types diff --git a/lib/structs.js b/lib/structs.js index 302b45b..0c0b17b 100644 --- a/lib/structs.js +++ b/lib/structs.js @@ -496,29 +496,6 @@ exports.encrypted = { }, }; -/** - * Message encodings. Extends {@link var_int} by adding known encoding type - * constants. - * @see {@link https://bitmessage.org/wiki/Protocol_specification#Message_Encodings} - * @namespace - */ -exports.messageEncodings = objectAssign(Object.create(var_int), { - /** - * Any data with this number may be ignored. The sending node might - * simply be sharing its public key with you. - */ - IGNORE: 0, - /** - * UTF-8. No 'Subject' or 'Body' sections. Useful for simple strings - * of data, like URIs or magnet links. - */ - TRIVIAL: 1, - /** - * UTF-8. Uses 'Subject' and 'Body' sections. No MIME is used. - */ - SIMPLE: 2, -}); - // Creates bitfield class of the specified size. var bitfield = function(size) { var bytesize = size / 8; diff --git a/test.js b/test.js index 8fad570..c3ecf9b 100644 --- a/test.js +++ b/test.js @@ -14,7 +14,6 @@ var var_int_list = structs.var_int_list; var net_addr = structs.net_addr; var inv_vect = structs.inv_vect; var encrypted = structs.encrypted; -var messageEncodings = structs.messageEncodings; var serviceFeatures = structs.serviceFeatures; var pubkeyFeatures = structs.pubkeyFeatures; var messages = bitmessage.messages; @@ -263,16 +262,6 @@ describe("Common structures", function() { }); }); - describe("message encodings", function() { - it("should decode", function() { - expect(messageEncodings.decode(Buffer([2])).value).to.equal(messageEncodings.SIMPLE); - }); - - it("should encode", function() { - expect(messageEncodings.encode(messageEncodings.SIMPLE).toString("hex")).to.equal("02"); - }); - }); - describe("service features", function() { it("should decode", function() { expect(serviceFeatures.decode(Buffer("0000000000000001", "hex"))).to.have.members([serviceFeatures.NODE_NETWORK]);