iota-gateway
Advanced tools
Comparing version 0.1.5 to 0.1.7
@@ -77,3 +77,3 @@ "use strict"; | ||
})); | ||
const onTransportReceive = (data, neighbor) => this.emit('receive', data, neighbor.address); | ||
const onTransportReceive = (data, neighbor, address) => this.emit('receive', data, address); | ||
const onTransportError = (error) => this.emit('error', error); | ||
@@ -132,5 +132,5 @@ for (const transport of this._transports) { | ||
} | ||
await this._neighborsTransportsMap.get(neighbor).send(data, neighbor); | ||
await this._neighborsTransportsMap.get(neighbor).send(data, neighbor, neighborAddress); | ||
} | ||
} | ||
exports.Gateway = Gateway; |
@@ -12,3 +12,3 @@ /// <reference types="node" /> | ||
abstract removeNeighbor(neighbor: Neighbor): Promise<void>; | ||
abstract send(data: Data, neighbor: Neighbor): Promise<void>; | ||
abstract send(data: Data, neighbor: Neighbor, address: string): Promise<void>; | ||
} |
{ | ||
"name": "iota-gateway", | ||
"version": "0.1.5", | ||
"version": "0.1.7", | ||
"description": "Network gateway for IOTA", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -16,3 +16,3 @@ import { Transaction, Hash } from 'iota-tangle' | ||
private _onTransportReceive: ((data: Data, neighbor: Neighbor) => void) | null = null | ||
private _onTransportReceive: ((data: Data, neighbor: Neighbor, address: string) => void) | null = null | ||
private _onTransportError: ((error: any) => void) | null = null | ||
@@ -112,3 +112,3 @@ | ||
const onTransportReceive = (data: Data, neighbor: Neighbor) => this.emit('receive', data, neighbor.address) | ||
const onTransportReceive = (data: Data, neighbor: Neighbor, address) => this.emit('receive', data, address) | ||
@@ -123,3 +123,3 @@ const onTransportError = (error: any) => this.emit('error', error) | ||
this._onTransportReceive = onTransportReceive | ||
this._onTransportError = onTransportError | ||
this._onTransportError = onTransportError | ||
@@ -182,4 +182,4 @@ } catch (error) { | ||
await this._neighborsTransportsMap.get(neighbor).send(data, neighbor) | ||
await this._neighborsTransportsMap.get(neighbor).send(data, neighbor, neighborAddress) | ||
} | ||
} |
@@ -16,3 +16,3 @@ import { EventEmitter } from 'events' | ||
abstract async send(data: Data, neighbor: Neighbor): Promise<void> | ||
abstract async send(data: Data, neighbor: Neighbor, address: string): Promise<void> | ||
} |
@@ -99,3 +99,3 @@ import { expect, use }from 'chai' | ||
transports[0].emit('receive', data, neighbor) | ||
transports[0].emit('receive', data, neighbor, neighbor.address) | ||
@@ -102,0 +102,0 @@ expect(receiveEventCallback).to.have.been.called |
48753