From 2ceb06d410417195b5892b6a22fed4f455724c1c Mon Sep 17 00:00:00 2001 From: sbhatnagar Date: Wed, 1 Apr 2020 11:41:43 -0400 Subject: [PATCH 1/2] adding stop method for xrp --- lib/index.js | 4 ++++ lib/xrp/XrpRpc.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/index.js b/lib/index.js index 40aab3fb..1628eea1 100644 --- a/lib/index.js +++ b/lib/index.js @@ -125,6 +125,10 @@ class CryptoRpcProvider { getAccountInfo(params) { return this.get(params.currency).getAccountInfo(params); } + + stop(params) { + return this.get(params.currency).stop(); + } } module.exports = CryptoRpcProvider; diff --git a/lib/xrp/XrpRpc.js b/lib/xrp/XrpRpc.js index 0f84ff78..e8834d6b 100644 --- a/lib/xrp/XrpRpc.js +++ b/lib/xrp/XrpRpc.js @@ -274,6 +274,10 @@ class XrpRpc { getAccountInfo({ address }) { return this.asyncRequest('account_info', { account: address }); } + + async stop() { + await this.rpc.disconnect(); + } } module.exports = XrpRpc; From 485bfbfa49284204fb86ade4ffc8616b078c8462 Mon Sep 17 00:00:00 2001 From: sbhatnagar Date: Wed, 13 May 2020 14:19:19 -0400 Subject: [PATCH 2/2] adding dummy methods to each rpc --- lib/btc/BtcRpc.js | 4 ++++ lib/eth/EthRpc.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/btc/BtcRpc.js b/lib/btc/BtcRpc.js index e981ad41..378519ee 100644 --- a/lib/btc/BtcRpc.js +++ b/lib/btc/BtcRpc.js @@ -283,6 +283,10 @@ class BtcRpc { getAccountInfo() { return {}; } + + async stop() { + return {}; + } } module.exports = BtcRpc; diff --git a/lib/eth/EthRpc.js b/lib/eth/EthRpc.js index 90215aff..fa4062ac 100644 --- a/lib/eth/EthRpc.js +++ b/lib/eth/EthRpc.js @@ -313,5 +313,9 @@ class EthRPC { getAccountInfo() { return {}; } + + async stop() { + return {}; + } } module.exports = EthRPC;