From 311c76a23cea727a87a455d74038b036b586b69d Mon Sep 17 00:00:00 2001 From: Josh Levine Date: Mon, 11 Nov 2019 20:36:45 -0500 Subject: [PATCH] add tracksTransactions to sai to dai execute method --- .../dai-plugin-migrations/src/migrations/SaiToDai.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/dai-plugin-migrations/src/migrations/SaiToDai.js b/packages/dai-plugin-migrations/src/migrations/SaiToDai.js index dc6124a41..614c06789 100644 --- a/packages/dai-plugin-migrations/src/migrations/SaiToDai.js +++ b/packages/dai-plugin-migrations/src/migrations/SaiToDai.js @@ -1,3 +1,4 @@ +import tracksTransactions from '@makerdao/dai/dist/src/utils/tracksTransactions'; import { SAI } from '..'; export default class SaiToDai { @@ -11,7 +12,8 @@ export default class SaiToDai { return this._sai.balance(); } - async execute(amount) { + @tracksTransactions + async execute(amount, { promise }) { const formattedAmount = SAI(amount).toFixed('wei'); const address = this._manager.get('web3').currentAddress(); const migrationContract = this._manager @@ -22,9 +24,11 @@ export default class SaiToDai { migrationContract.address ); if (allowance.toNumber() < amount) { - await this._sai.approve(migrationContract.address, formattedAmount); + await this._sai.approve(migrationContract.address, formattedAmount, { + promise + }); } - return migrationContract.swapSaiToDai(formattedAmount); + return migrationContract.swapSaiToDai(formattedAmount, { promise }); } }