diff --git a/packages/dai-plugin-migrations/src/migrations/MkrRedeemer.js b/packages/dai-plugin-migrations/src/migrations/MkrRedeemer.js index a7996c490..93096629a 100644 --- a/packages/dai-plugin-migrations/src/migrations/MkrRedeemer.js +++ b/packages/dai-plugin-migrations/src/migrations/MkrRedeemer.js @@ -4,12 +4,12 @@ export default class MkrRedeemer { return this; } - async check() { - const balance = await this.oldMkrBalance(); - return balance.gt(0); - } + // async check() { + // const balance = await this.oldMkrBalance(); + // return balance.gt(0); + // } - oldMkrBalance() { + async check() { const oldMkr = this._manager.get('token').getToken('OLD_MKR'); return oldMkr.balance(); } diff --git a/packages/dai-plugin-migrations/test/migrations/MkrRedeemer.spec.js b/packages/dai-plugin-migrations/test/migrations/MkrRedeemer.spec.js index 2a66274f7..6ae7fc8e1 100644 --- a/packages/dai-plugin-migrations/test/migrations/MkrRedeemer.spec.js +++ b/packages/dai-plugin-migrations/test/migrations/MkrRedeemer.spec.js @@ -1,5 +1,6 @@ import { migrationMaker } from '../helpers'; import { ServiceRoles, Migrations } from '../../src/constants'; +import { OLD_MKR } from '../../src'; let maker, migration; @@ -11,22 +12,16 @@ describe('MKR migration check', () => { .getMigration(Migrations.MKR_REDEEMER); }); - test('if the account has no old MKR, return false', async () => { + test('if the account has no old MKR, return zero', async () => { await addFreshAccount(); maker.service('accounts').useAccount('newAccount'); - const amount = await migration.oldMkrBalance(); - - expect(amount.toNumber()).toBe(0); - expect(await migration.check()).toBeFalsy(); - + expect(await migration.check()).toEqual(OLD_MKR(0)); maker.service('accounts').useAccount('default'); }); - test('if the account has old MKR, return true', async () => { - const amount = await migration.oldMkrBalance(); - - expect(amount.toNumber()).toBe(400); - expect(await migration.check()).toBeTruthy(); + test('if the account has old MKR, return balance', async () => { + const amount = await migration.check(); + expect(amount).toEqual(OLD_MKR(400)); }); });