Skip to content

Commit

Permalink
#11 Adjust typo from approveTrasferAsync to approveTransferAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
ceres3idoo committed Feb 22, 2019
1 parent a449b4e commit 4c7a7a8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/lib/tradingWallet/approve/approve.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const erc20TokenServiceBuilder = new Erc20TokenServiceBuilder(tokenAddress)
const erc20TokenService = erc20TokenServiceBuilder.build()

const transactionHash = await erc20TokenService.approveTrasferAsync(
const transactionHash = await erc20TokenService.approveTransferAsync(
personalWalletAddress,
tradingWalletAddress,
toDeposit,
Expand Down
2 changes: 1 addition & 1 deletion src/facades/TradingWalletFacade.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class TradingWalletFacade {
'The quantity to deposit is not completely allowed!')

const zeroQuantity = 0
approveToZeroTransactionHash = await this.erc20TokenService.approveTrasferAsync(
approveToZeroTransactionHash = await this.erc20TokenService.approveTransferAsync(
personalWalletAddress,
tradingWalletAddress,
zeroQuantity,
Expand Down
4 changes: 2 additions & 2 deletions src/services/Erc20TokenService.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class Erc20TokenService extends BaseTransactionService {
* @param {String} tokenAddress The address of the token asset to withdraw.
* @param {String} privateKey The private key.
*/
async approveTrasferAsync(personalWalletAddress, tradingWalletAddress, quantity, privateKey) {
async approveTransferAsync(personalWalletAddress, tradingWalletAddress, quantity, privateKey) {
this.checkEtherumAddress(personalWalletAddress)
this.checkEtherumAddress(tradingWalletAddress)

this.log.info({
fn: 'approveTrasferAsync',
fn: 'approveTransferAsync',
tradingWalletAddress,
quantity,
personalWalletAddress,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facades/TradingWalletFacade.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ describe('DepositTokenAsync', () => {

sandbox.stub(tradingWalletFacade.erc20TokenService, 'getBalanceOfAsync').returns(balanceOfQuantity)
sandbox.stub(tradingWalletFacade.erc20TokenService, 'getAllowanceAsync').returns(allowance)
sandbox.stub(tradingWalletFacade.erc20TokenService, 'approveTrasferAsync').returns(approveZeroTxHash)
sandbox.stub(tradingWalletFacade.erc20TokenService, 'approveTransferAsync').returns(approveZeroTxHash)
const executeMock = sandbox.stub(tradingWalletFacade.transactionLib, 'execute')
executeMock.onFirstCall().returns(approveTxHash)
executeMock.onSecondCall().returns(depositTxHash)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/services/Erc20TokenService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ afterEach(() => {
sandbox.restore()
})

describe('approveTrasferAsync', () => {
describe('approveTransferAsync', () => {
const privateKey = '0x0e72f985ad5de44fd7ffafe2b689f1030bb82e45537ed3a60aa10f9c49affbc2'
const personalWalletAddress = '0x52daf0caee4cf4e66a9c90dad58c3f0cc4cbf785'
const quantity = '100000000000000000'
Expand All @@ -63,7 +63,7 @@ describe('approveTrasferAsync', () => {
sandbox.stub(ethApiLib, 'getAddressNonceAsync').returns(nonceResponse)
sandbox.stub(ethApiLib, 'getEstimateGasAsync').returns(gasEstimationResponse)

const transactionHash = await erc20TokenService.approveTrasferAsync(personalWalletAddress,
const transactionHash = await erc20TokenService.approveTransferAsync(personalWalletAddress,
tradingWalletAddress, quantity, tokenAddress, privateKey)

expect(transactionHash).toEqual(expectedTransactionHash)
Expand Down

0 comments on commit 4c7a7a8

Please sign in to comment.