diff --git a/src/commands/commandList.js b/src/commands/commandList.js index 782e742..cc7a094 100644 --- a/src/commands/commandList.js +++ b/src/commands/commandList.js @@ -52,9 +52,6 @@ const getBalanceCommand = new GetBalanceCommand(logger, tradingWalletService, const createWalletCommand = new CreateWalletCommand(logger, getAllowanceCommandValidator, createWalletCommandValidator, privateKeyService, privateKeyValidator) -const getTradingWalletBalanceCommand = new GetTradingWalletBalanceCommand(logger, tradingWalletService, - getTradingWalletBalanceCommandValidator, privateKeyService, privateKeyValidator) - const depositEthCommand = new DepositEthCommand(logger, tradingWalletService, depositEthCommandValidator, privateKeyService, privateKeyValidator) diff --git a/src/commands/index.js b/src/commands/index.js index 59431bd..300a881 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -4,7 +4,7 @@ const commandList = require('./commandList') const CreateWalletCommand = require('./CreateWalletCommand') const DepositEthCommand = require('./DepositEthCommand') const GetAddressCommand = require('./GetAddressCommand') -const GetTradingWalletBalanceCommand = require('./GetBalanceCommand') +const GetBalanceCommand = require('./GetBalanceCommand') const OrderSignCommand = require('./OrderSignCommand') module.exports = { @@ -14,6 +14,6 @@ module.exports = { CreateWalletCommand, DepositEthCommand, GetAddressCommand, - GetTradingWalletBalanceCommand, + GetBalanceCommand, OrderSignCommand, } diff --git a/tests/unit/commands/getTradingWalletBalanceCommand.test.js b/tests/unit/commands/getTradingWalletBalanceCommand.test.js index 9f9d00e..c76b1e2 100644 --- a/tests/unit/commands/getTradingWalletBalanceCommand.test.js +++ b/tests/unit/commands/getTradingWalletBalanceCommand.test.js @@ -17,7 +17,7 @@ const tradingWalletService = TradingWalletServiceBuilder.build() const privateKeyValidator = new PrivateKeyValidator(logger) const privateKeyService = new PrivateKeyService(logger) -const getTradingWalletBalanceCommand = new GetBalanceCommand(logger, tradingWalletService, +const getBalanceCommand = new GetBalanceCommand(logger, tradingWalletService, getBalanceCommandValidator, privateKeyService, privateKeyValidator) afterEach(() => { @@ -41,7 +41,7 @@ describe('tws get-balance', () => { }, ] - const result = await getTradingWalletBalanceCommand + const result = await getBalanceCommand .executeAsync({ from: invalidFrom, to, token }) expect(result).toMatchObject(expectedResult) @@ -55,19 +55,19 @@ describe('tws get-balance', () => { message: 'from is required', }] - const result = await getTradingWalletBalanceCommand.executeAsync({ from, to, token }) + const result = await getBalanceCommand.executeAsync({ from, to, token }) expect(result).toMatchObject(expectedResult) }) }) - describe('should execute GetTradingWalletBalanceCommand as expected', () => { + describe('should execute GetBalanceCommand as expected', () => { const draftValues = [false, undefined] test.each(draftValues)('should return the tradingWallet asset balance with draft value = %o', async (draft) => { const expectedTradinWalletAssetBalance = '1' sandbox.stub(tradingWalletService.transactionLib.ethApiClient, 'transactionCallAsync') .returns(expectedTradinWalletAssetBalance) - const result = await getTradingWalletBalanceCommand.executeAsync({ from, to, token, draft }) + const result = await getBalanceCommand.executeAsync({ from, to, token, draft }) expect(result).toBe(expectedTradinWalletAssetBalance) }) @@ -79,7 +79,7 @@ describe('tws get-balance', () => { value: '0x0', } - const result = await getTradingWalletBalanceCommand + const result = await getBalanceCommand .executeAsync({ from, to, token, draft: true }) expect(result).toMatchObject(expectedTransactionObjectDraft)