Compare commits
No commits in common. "d3d0f387b66148dcc202a3ef0cb2cd1b7fa5d571" and "90d8bfba63b089a61ea93a7dd4b84c712c21c2f5" have entirely different histories.
d3d0f387b6
...
90d8bfba63
|
@ -32,10 +32,12 @@ class PluginAPI extends EventEmitter2 {
|
|||
|
||||
constructor({
|
||||
config,
|
||||
logger,
|
||||
server,
|
||||
swarm,
|
||||
}: {
|
||||
config: Config;
|
||||
logger: Logger;
|
||||
server: RPCServer;
|
||||
swarm: any;
|
||||
}) {
|
||||
|
@ -45,6 +47,7 @@ class PluginAPI extends EventEmitter2 {
|
|||
maxListeners: 0,
|
||||
});
|
||||
this._config = config;
|
||||
this._logger = logger;
|
||||
this._server = server;
|
||||
this._swarm = swarm;
|
||||
}
|
||||
|
@ -71,8 +74,10 @@ class PluginAPI extends EventEmitter2 {
|
|||
throw new Error("not implemented and should not be called");
|
||||
}
|
||||
|
||||
private _logger: Logger;
|
||||
|
||||
get logger(): Logger {
|
||||
throw new Error("not implemented and should not be called");
|
||||
return this._logger;
|
||||
}
|
||||
|
||||
get rpcServer(): RPCServer {
|
||||
|
@ -110,6 +115,7 @@ export function getPluginAPI(): PluginAPI {
|
|||
if (!pluginAPI) {
|
||||
pluginAPI = new PluginAPI({
|
||||
config,
|
||||
logger: log,
|
||||
server: getRpcServer(),
|
||||
swarm: getSwarm(),
|
||||
});
|
||||
|
@ -206,10 +212,6 @@ export class PluginAPIManager {
|
|||
});
|
||||
}
|
||||
|
||||
if (prop === "logger") {
|
||||
return log.child({ plugin: plugin.name });
|
||||
}
|
||||
|
||||
return (target as any)[prop];
|
||||
},
|
||||
})
|
||||
|
|
|
@ -71,7 +71,7 @@ export class ProtocolManager {
|
|||
this._swarm.on("connection", (peer: any) => {
|
||||
for (const protocol of this._protocols) {
|
||||
Protomux.from(peer).pair(
|
||||
{ protocol: protocol[0] },
|
||||
protocol[0],
|
||||
this.handler.bind(this, protocol[0], peer)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue