Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
b-pmcg committed Nov 16, 2021
1 parent 3200731 commit e529a1a
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 58 deletions.
3 changes: 1 addition & 2 deletions packages/dai-plugin-governance/test/helpers/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fetch from 'node-fetch';
// import Maker from '@makerdao/dai';
import Maker from '../../../dai/src';
import Maker from '@makerdao/dai';
import govPlugin from '../../src/index';
import configPlugin from '@makerdao/dai-plugin-config';
import { createCurrency } from '@makerdao/currency';
Expand Down
4 changes: 2 additions & 2 deletions packages/dai-plugin-liquidations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"test": "yarn testchain --ci jest --runInBand"
},
"peerDependencies": {
"@makerdao/dai": "^0.41.0-alpha.2"
"@makerdao/dai": "^0.41.0-alpha.9"
},
"dependencies": {
"@makerdao/currency": "0.9.9",
"@makerdao/services-core": "^0.11.0-alpha.4",
"@makerdao/services-core": "^0.11.0-alpha.9",
"bignumber.js": "^8.1.1",
"ramda": "^0.27.1"
},
Expand Down
6 changes: 1 addition & 5 deletions packages/dai-plugin-liquidations/src/LiquidationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import { PublicService } from '@makerdao/services-core';
import {
bytes32ToNumber,
numberToBytes32
} from '../../dai/src/utils/conversion';
// import {
// bytes32ToNumber,
// numberToBytes32
// } from '@makerdao/dai/src/utils/conversion';
} from '@makerdao/dai/src/utils/conversion';
import assert from 'assert';
import { utils } from 'ethers';
import tracksTransactions from './utils/tracksTransactions';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { takeSnapshot, restoreSnapshot } from '@makerdao/test-helpers';
// import Maker from '@makerdao/dai/';
import Maker from '../../dai/src';
// import { McdPlugin, YFI } from '@makerdao/dai-plugin-mcd';
import { McdPlugin, YFI } from '../../dai-plugin-mcd/src';
import Maker from '@makerdao/dai';
import { McdPlugin, YFI } from '@makerdao/dai-plugin-mcd';
import BigNumber from 'bignumber.js';
import liquidationPlugin from '../src';
import LiquidationService, {
Expand Down
3 changes: 1 addition & 2 deletions packages/dai-plugin-liquidations/test/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// import { DAI } from '@makerdao/dai-plugin-mcd';
import { DAI } from '../../dai-plugin-mcd/src';
import { DAI } from '@makerdao/dai-plugin-mcd';
import { mineBlocks } from '../../test-helpers/src';
import BigNumber from 'bignumber.js';
import { stringToBytes } from '../src/LiquidationService';
Expand Down
5 changes: 0 additions & 5 deletions packages/dai-plugin-mcd/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ export function stringToBytes(str) {
assert(typeof str === 'string', 'argument is not a string');
return ethersUtils.formatBytes32String(str);
}
// export function stringToBytes(str) {
// assert(!!str, 'argument is falsy');
// assert(typeof str === 'string', 'argument is not a string');
// return '0x' + Buffer.from(str).toString('hex');
// }

export function bytesToString(hex) {
return Buffer.from(hex.replace(/^0x/, ''), 'hex')
Expand Down
3 changes: 1 addition & 2 deletions packages/dai-plugin-mcd/test/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import assert from 'assert';
import { createCurrencyRatio } from '@makerdao/currency';
// import Maker from '@makerdao/dai';
import Maker from '../../dai/src';
import Maker from '@makerdao/dai';
import { McdPlugin, ETH, USD, GNT } from '../src';
import { stringToBytes } from '../src/utils';
import { ServiceRoles } from '../src/constants';
Expand Down
6 changes: 3 additions & 3 deletions packages/dai-plugin-migrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"test": "yarn testchain --ci jest --runInBand"
},
"peerDependencies": {
"@makerdao/dai": "^0.41.0-alpha.2"
"@makerdao/dai": "^0.41.0-alpha.9"
},
"dependencies": {
"@makerdao/currency": "0.9.9",
"@makerdao/dai": "^0.41.0-alpha.5",
"@makerdao/services-core": "^0.11.0-alpha.4",
"@makerdao/dai": "^0.41.0-alpha.9",
"@makerdao/services-core": "^0.11.0-alpha.9",
"bignumber.js": "^8.1.1"
},
"gitHead": "689f3670142282c9483c74d5658f60161d4287bb"
Expand Down
14 changes: 3 additions & 11 deletions packages/dai-plugin-migrations/test/helpers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// import Maker from '@makerdao/dai';
import Maker from '../../../dai/src';
import Maker from '@makerdao/dai';
import MigrationPlugin from '../../src';
import { Migrations } from '../../src/constants';
import { createCurrencyRatio } from '@makerdao/currency';
Expand All @@ -8,15 +7,8 @@ import McdPlugin, {
ETH,
GNT,
USD
} from '../../../dai-plugin-mcd/src';
// import McdPlugin, {
// ServiceRoles,
// ETH,
// GNT,
// USD
// } from '@makerdao/dai-plugin-mcd';
import ScdPlugin from '../../../dai-plugin-scd/src';
// import ScdPlugin from '@makerdao/dai-plugin-scd';
} from '@makerdao/dai-plugin-mcd';
import ScdPlugin from '@makerdao/dai-plugin-scd';
import ethAbi from 'web3-eth-abi';
import { utils } from 'ethers';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { migrationMaker, setupCollateral } from '../helpers';
import { mockContracts, globalSettlement } from '../helpers/mocks';
import { takeSnapshot, restoreSnapshot } from '@makerdao/test-helpers';
import { ServiceRoles, Migrations } from '../../src/constants';
// import { DAI, ETH } from '@makerdao/dai-plugin-mcd';
import { DAI, ETH } from '../../../dai-plugin-mcd/src';
import { DAI, ETH } from '@makerdao/dai-plugin-mcd';

let maker, migration, smartContract, cdpManager, snapshot;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { migrationMaker, setupCollateral } from '../helpers';
import { mockContracts, globalSettlement } from '../helpers/mocks';
import { takeSnapshot, restoreSnapshot } from '@makerdao/test-helpers';
import { ServiceRoles, Migrations } from '../../src/constants';
// import { DAI, ETH } from '@makerdao/dai-plugin-mcd';
import { DAI, ETH } from '../../../dai-plugin-mcd/src';
import { DAI, ETH } from '@makerdao/dai-plugin-mcd';

jest.setTimeout(30000);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { migrationMaker, setupCollateral } from '../helpers';
import { mockContracts, globalSettlement } from '../helpers/mocks';
import { takeSnapshot, restoreSnapshot } from '@makerdao/test-helpers';
import { ServiceRoles, Migrations } from '../../src/constants';
// import { DAI, ETH } from '@makerdao/dai-plugin-mcd';
import { DAI, ETH } from '../../../dai-plugin-mcd/src';
import { ETH, DAI } from '@makerdao/dai-plugin-mcd';

let maker, migration, cdpManager, smartContract, snapshot;

Expand Down
6 changes: 3 additions & 3 deletions packages/dai-plugin-scd/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@makerdao/dai-plugin-scd",
"description": "Plugin to add Single-Collateral Dai support to dai.js",
"version": "1.3.0-alpha.4",
"version": "1.3.0-alpha.9",
"license": "MIT",
"main": "dist/index.js",
"unpkg": "dist/index.js",
Expand All @@ -20,11 +20,11 @@
"test:integration": "export NETWORK='test' && yarn test --config ./test/config/jestIntegrationConfig.json"
},
"peerDependencies": {
"@makerdao/dai": "^0.41.0-alpha.2"
"@makerdao/dai": "^0.41.0-alpha.9"
},
"dependencies": {
"@makerdao/currency": "^0.9.9",
"@makerdao/services-core": "^0.11.0-alpha.4",
"@makerdao/services-core": "^0.11.0-alpha.9",
"assert": "^2.0.0",
"bignumber.js": "^8.1.1",
"chokidar": "^2.0.4",
Expand Down
3 changes: 1 addition & 2 deletions packages/dai-plugin-scd/src/EthereumCdpService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ export default class EthereumCdpService extends PrivateService {
}

async getLiquidationPrice(cdpId) {
// ..
const [debt, liqRatio, collateral] = await Promise.all([
this.getDebtValue(cdpId, USD),
this.getLiquidationRatio(),
Expand Down Expand Up @@ -471,7 +470,7 @@ export default class EthereumCdpService extends PrivateService {
const hexCdpId = numberToBytes32(cdpId);
const valueEth = getCurrency(amountEth, ETH).toFixed('wei');
const valueSai = getCurrency(amountSai, SAI).toFixed('wei');
//

return this._saiProxyTubContract().lockAndDraw(
this._tubContract().address,
hexCdpId,
Expand Down
3 changes: 0 additions & 3 deletions packages/dai/src/eth/Web3Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ export default class Web3Service extends PrivateService {
https://web3js.readthedocs.io/en/1.0/web3-eth.html#sendtransaction
*/
sendTransaction(...args) {
// const prov = new ethers.providers.Web3Provider(this.web3Provider());
//@ts-ignore
// return prov.getSigner().sendTransaction(...args);
return new Promise((resolve, reject) => {
this._web3.eth
.sendTransaction(...args)
Expand Down
8 changes: 3 additions & 5 deletions packages/dai/test/eth/TransactionManager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import {
buildTestSmartContractService
} from '../helpers/serviceBuilders';
import { uniqueId } from '../../src/utils';
import { mineBlocks } from '../../../test-helpers/src';
import { size } from 'lodash';
// import { mineBlocks } from '@makerdao/test-helpers';
import { mineBlocks } from '@makerdao/test-helpers';
import debug from 'debug';
const log = debug('sai:testing:TxMgr.spec');
import Maker from '../../src';
import ScdPlugin from '../../../dai-plugin-scd/src';
// import ScdPlugin from '@makerdao/dai-plugin-scd';
import ScdPlugin from '@makerdao/dai-plugin-scd';

async function scdMaker({
preset = 'test',
Expand Down Expand Up @@ -64,7 +62,7 @@ test('reuse the same web3 service in test services', () => {
expect(services.currentAddress).toMatch(/^0x[0-9A-Fa-f]+$/);
}, 30000);

test('contract call accepts a businessObject option', async () => {
test('wrapped contract call accepts a businessObject option', async () => {
expect.assertions(3);
const token = services.contract.getContract('WETH');

Expand Down
6 changes: 3 additions & 3 deletions packages/dai/test/eth/tokens/EtherToken.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ test('ether transfer should move transferValue from sender to receiver', done =>
receiverBalance = ETH(balances[1]);
return token.transfer(receiver, '0.1');
})
.then(() => {
return Promise.all([token.balanceOf(sender), token.balanceOf(receiver)]);
})
.then(() =>
Promise.all([token.balanceOf(sender), token.balanceOf(receiver)])
)
.then(balances => {
const newSenderBalance = ETH(balances[0]),
newReceiverBalance = ETH(balances[1]);
Expand Down

0 comments on commit e529a1a

Please sign in to comment.