bip151: minor.

This commit is contained in:
Christopher Jeffrey 2016-07-22 22:40:13 -07:00
parent 16eaa4402e
commit 54cf5ce341
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 11 additions and 11 deletions

View File

@ -371,7 +371,7 @@ BIP151.prototype.feed = function feed(data) {
};
// TODO: We could batch packets here!
BIP151.prototype.frame = function frame(cmd, body) {
BIP151.prototype.packet = function packet(cmd, body) {
var p = bcoin.writer();
var payload, packet;
@ -388,7 +388,7 @@ BIP151.prototype.frame = function frame(cmd, body) {
this.finish().copy(packet, 4 + payload.length);
this.sequence();
this.maybeRekey(payload);
this.maybeRekey(packet);
return packet;
};

View File

@ -34,7 +34,7 @@ describe('BIP151', function() {
});
it('should encrypt payload from client to server', function() {
var packet = client.frame('fake', payload);
var packet = client.packet('fake', payload);
var emitted = false;
server.once('packet', function(cmd, body) {
emitted = true;
@ -46,7 +46,7 @@ describe('BIP151', function() {
});
it('should encrypt payload from server to client', function() {
var packet = server.frame('fake', payload);
var packet = server.packet('fake', payload);
var emitted = false;
client.once('packet', function(cmd, body) {
emitted = true;
@ -58,7 +58,7 @@ describe('BIP151', function() {
});
it('should encrypt payload from client to server (2)', function() {
var packet = client.frame('fake', payload);
var packet = client.packet('fake', payload);
var emitted = false;
server.once('packet', function(cmd, body) {
emitted = true;
@ -70,7 +70,7 @@ describe('BIP151', function() {
});
it('should encrypt payload from server to client (2)', function() {
var packet = server.frame('fake', payload);
var packet = server.packet('fake', payload);
var emitted = false;
client.once('packet', function(cmd, body) {
emitted = true;
@ -87,7 +87,7 @@ describe('BIP151', function() {
client.once('rekey', function() {
rekeyed = true;
var packet = client.frame('encack', client.toRekey());
var packet = client.packet('encack', client.toRekey());
var emitted = false;
server.once('packet', function(cmd, body) {
emitted = true;
@ -111,7 +111,7 @@ describe('BIP151', function() {
});
it('should encrypt payload from client to server after rekey', function() {
var packet = client.frame('fake', payload);
var packet = client.packet('fake', payload);
var emitted = false;
server.once('packet', function(cmd, body) {
emitted = true;
@ -123,7 +123,7 @@ describe('BIP151', function() {
});
it('should encrypt payload from server to client after rekey', function() {
var packet = server.frame('fake', payload);
var packet = server.packet('fake', payload);
var emitted = false;
client.once('packet', function(cmd, body) {
emitted = true;
@ -135,7 +135,7 @@ describe('BIP151', function() {
});
it('should encrypt payload from client to server after rekey (2)', function() {
var packet = client.frame('fake', payload);
var packet = client.packet('fake', payload);
var emitted = false;
server.once('packet', function(cmd, body) {
emitted = true;
@ -147,7 +147,7 @@ describe('BIP151', function() {
});
it('should encrypt payload from server to client after rekey (2)', function() {
var packet = server.frame('fake', payload);
var packet = server.packet('fake', payload);
var emitted = false;
client.once('packet', function(cmd, body) {
emitted = true;