events lib update

This commit is contained in:
Andrey Fedorov
2012-11-05 10:08:33 -08:00
committed by Stefan Thomas
parent 2702ec906b
commit 69c5caa0c7
2 changed files with 279 additions and 65 deletions

View File

@@ -16,11 +16,11 @@
// Node
var util = require('util');
var EventEmitter = require('events').EventEmitter;
// npm
var WebSocket = require('ws');
var EventEmitter = require('./events').EventEmitter;
var Amount = require('./amount.js').Amount;
var UInt160 = require('./amount.js').UInt160;
@@ -50,19 +50,6 @@ var Request = function (remote, command) {
Request.prototype = new EventEmitter;
// Return this. node EventEmitter's on doesn't return this.
Request.prototype.on = function (e, c) {
EventEmitter.prototype.on.call(this, e, c);
return this;
};
Request.prototype.once = function (e, c) {
EventEmitter.prototype.once.call(this, e, c);
return this;
};
// Send the request to a remote.
Request.prototype.request = function (remote) {
this.emit('request', remote);
@@ -884,13 +871,6 @@ var Transaction = function (remote) {
Transaction.prototype = new EventEmitter;
// Return this. node EventEmitter's on doesn't return this.
Transaction.prototype.on = function (e, c) {
EventEmitter.prototype.on.call(this, e, c);
return this;
};
Transaction.prototype.consts = {
'telLOCAL_ERROR' : -399,
'temMALFORMED' : -299,