Skip to content

Commit

Permalink
Restore BN export (#428)
Browse files Browse the repository at this point in the history
The `BN` export was removed in #398. I hadn't anticipated at the time
that this would constitute a breaking change. It turns out that this
export was relied upon in mobile in one place.

It has been temporarily restored, along with a comment that suggests
we remove it in the next major version.
  • Loading branch information
Gudahtt authored Mar 23, 2021
1 parent ed4df47 commit 059129f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/assets/TokenBalancesController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { PreferencesController } from '../user/PreferencesController';
import { AssetsController } from './AssetsController';
import { Token } from './TokenRatesController';
import { AssetsContractController } from './AssetsContractController';
import TokenBalancesController from './TokenBalancesController';
import { BN as exportedBn, TokenBalancesController } from './TokenBalancesController';

const MAINNET_PROVIDER = new HttpProvider('https://mainnet.infura.io');

Expand All @@ -28,6 +28,10 @@ describe('TokenBalancesController', () => {
sandbox.restore();
});

it('should re-export BN', () => {
expect(exportedBn).toEqual(BN);
});

it('should set default state', () => {
expect(tokenBalances.state).toEqual({ contractBalances: {} });
});
Expand Down
3 changes: 3 additions & 0 deletions src/assets/TokenBalancesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import AssetsController from './AssetsController';
import { Token } from './TokenRatesController';
import { AssetsContractController } from './AssetsContractController';

// TODO: Remove this export in the next major release
export { BN };

/**
* @type TokenBalancesConfig
*
Expand Down

0 comments on commit 059129f

Please sign in to comment.