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 }); } }