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

Trying to update ethers, a terrible mistake right now #292

Draft
wants to merge 32 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c12d7ac
Compiles, but does not work for tests
rafinskipg Sep 23, 2021
aa10601
First tests for dai core
rafinskipg Sep 25, 2021
f830e1c
Lint
rafinskipg Sep 25, 2021
92c0898
In process of going green
rafinskipg Sep 26, 2021
81b4de5
test: trying to get test to work
rafinskipg Sep 27, 2021
475d044
ci
rafinskipg Sep 27, 2021
c427c50
ci
rafinskipg Sep 27, 2021
1cadd0b
target es5
rafinskipg Sep 27, 2021
88bbc6e
timeouts
rafinskipg Sep 27, 2021
cb91e37
Migrate to tsdx for compiling to multiple targets, migrated module dai
rafinskipg Sep 27, 2021
169579c
services core and liquidations
rafinskipg Sep 28, 2021
38fce48
dai-plugin-scd
rafinskipg Sep 28, 2021
5a5675e
dai-plugin-mcd
rafinskipg Sep 28, 2021
b793448
dai-plugin-mcd
rafinskipg Sep 28, 2021
9f62768
dai-plugin-governance
rafinskipg Sep 28, 2021
9265dcc
fix: Tests for governance plugin
rafinskipg Sep 28, 2021
83360b2
fix dependencies and build
rafinskipg Sep 28, 2021
b5cdc0a
Cross fingers
rafinskipg Sep 28, 2021
85956f7
more fixes
rafinskipg Sep 28, 2021
ac58077
Cross fingers
rafinskipg Sep 28, 2021
5eb53bf
Cross fingers
rafinskipg Sep 28, 2021
10a6671
Cross fingers
rafinskipg Sep 28, 2021
4a61486
trying to get test to run
rafinskipg Sep 29, 2021
6c08dad
trying to get test to run
rafinskipg Sep 29, 2021
00c3c19
fix servicess core
rafinskipg Sep 29, 2021
5d56890
trying to fix services core dependencies
rafinskipg Sep 29, 2021
05cfcf5
Kill me
rafinskipg Oct 4, 2021
c54e542
more stuff
rafinskipg Oct 4, 2021
467a3ee
Lint
rafinskipg Oct 4, 2021
be50571
Merge branch 'dev' of github.com:makerdao/dai.js into typescript
rafinskipg Oct 5, 2021
a8ed02d
chore: Trying to update ethers
rafinskipg Oct 5, 2021
3c22c85
lint
rafinskipg Oct 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
jobs:
build:
docker:
- image: levity/dapptools-node-latest
- image: makerdaodux/dapptools-node-circleci-docker
steps:
- checkout
- run:
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"node": true
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"singleQuote": true
"singleQuote": true,
"parser": "typescript"
}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,17 @@ Run `yarn coverage` to generate a test coverage report.

See [packages/dai/README.md](https://github.com/makerdao/dai.js/blob/dev/packages/dai/README.md#commands) for instructions.


## Adding a package as dependency of another

```
npx lerna add @makerdao/services-core packages/dai-plugin-mcd
```



[build]: https://circleci.com/gh/makerdao/dai.js.svg?style=svg
[build-url]: https://circleci.com/gh/makerdao/dai.js
[cover]: https://codecov.io/gh/makerdao/dai.js/branch/dev/graph/badge.svg
[cover-url]: https://codecov.io/gh/makerdao/dai.js

22 changes: 0 additions & 22 deletions babel.config.js

This file was deleted.

33 changes: 14 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
"lint-staged": {
"./packages/**/{src,web,test,contracts}/**/*.js": [
"./packages/**/{src,web,test,contracts}/**/*.(j|t)s": [
"prettier --single-quote --write",
"eslint"
]
Expand All @@ -32,39 +32,34 @@
"packages/*"
],
"dependencies": {
"lerna": "^3.15.0"
"lerna": "^4.0.0"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.4.5",
"@babel/node": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-proposal-decorators": "^7.3.0",
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
"@babel/plugin-proposal-function-sent": "^7.2.0",
"@babel/plugin-proposal-numeric-separator": "^7.2.0",
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/plugin-proposal-throw-expressions": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.3.4",
"@babel/preset-env": "^7.4.5",
"@babel/core": "^7.15.5",
"@babel/plugin-proposal-decorators": "^7.15.4",
"@babel/preset-env": "^7.15.6",
"@babel/preset-typescript": "^7.15.0",
"@makerdao/testchain": "^1.1.33-beta5",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.8.0",
"babel-loader": "^8.0.5",
"babel-plugin-module-resolver": "^3.2.0",
"@types/jest": "^27.0.2",
"@types/node": "^16.10.1",
"@typescript-eslint/parser": "^4.31.2",
"chokidar": "^2.0.4",
"copyfiles": "^2.0.0",
"eslint": "^5.15.1",
"eslint-loader": "^2.1.2",
"husky": "^3.0.8",
"jest": "^24.5.0",
"jest": "^27.2.1",
"jest-fetch-mock": "^3.0.3",
"lint-staged": "^7.1.0",
"minimist": "^1.2.0",
"prettier": "^1.12.1",
"sane": "^4.0.3",
"solc": "^0.4.23",
"terser-webpack-plugin": "^2.3.6",
"ts-jest": "^27.0.5",
"ts-loader": "^9.2.6",
"tsdx": "^0.14.1",
"typescript": "^4.4.3",
"webpack": "^4.43.0",
"webpack-bundle-analyzer": "^3.7.0",
"webpack-cli": "^3.3.11"
Expand Down
1 change: 0 additions & 1 deletion packages/dai-plugin-governance/babel.config.js

This file was deleted.

9 changes: 7 additions & 2 deletions packages/dai-plugin-governance/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
module.exports = {
preset: 'ts-jest',
transform: {
'^.+\\.(ts|js)?$': 'ts-jest',
},
rootDir: './',
coverageReporters: ['json', 'lcov', 'text-summary'],
collectCoverageFrom: ['src/**/*.js'],
collectCoverageFrom: ['src/**/*.js', 'src/**/*.ts'],
roots: ['src', 'test'],
setupFilesAfterEnv: ['<rootDir>/test/config/original-setup.js'],
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/test/integration/'
]
],
testEnvironment : 'jsdom'
};
17 changes: 8 additions & 9 deletions packages/dai-plugin-governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"url": "https://github.com/makerdao/dai-plugin-governance.git"
},
"main": "dist/index.js",
"unpkg": "umd/index.js",
"jsdelivr": "umd/index.js",
"unpkg": "dist/index.js",
"jsdelivr": "dist/dai-plugin-governance.esm.js",
"typings": "dist/index.d.ts",
"module": "dist/dai-plugin-governance.esm.js",
"scripts": {
"build": "yarn clean && yarn build:cjs && yarn build:umd",
"build:umd": "webpack --config ../../webpack.config.js",
"clean": "rm -rf ./dist ./umd",
"build:cjs": "../../scripts/build.sh",
"build": "yarn clean && tsdx build && ./scripts/copy-files.sh",
"clean": "rm -rf ./dist",
"prepublishOnly": "yarn build",
"testchain": "../../scripts/run-testchain.sh",
"test": "yarn testchain --ci jest --runInBand",
Expand All @@ -29,17 +29,16 @@
},
"dependencies": {
"@makerdao/currency": "0.9.9",
"@makerdao/dai": "^0.32.13",
"@makerdao/services-core": "^0.10.0",
"assert": "^2.0.0",
"debug": "^4.1.1",
"ramda": "^0.25.0"
},
"peerDependencies": {
"@makerdao/dai": "^0.31"
"@makerdao/dai": "^0.32.13"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@makerdao/dai": "^0.31",
"@makerdao/dai-plugin-config": "^0.2.14-rc.1",
"web3-utils": "^1.2.6"
}
Expand Down
7 changes: 7 additions & 0 deletions packages/dai-plugin-governance/scripts/copy-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e

copyfiles contracts/abis/* dist/abis -f
copyfiles contracts/addresses/* dist/addresses -f
copyfiles contracts/contract-info.json dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TODO Remove ignore
// @ts-nocheck
import { PrivateService } from '@makerdao/services-core';
import { POLLING, BATCH_POLLING } from './utils/constants';
import { MKR } from './utils/constants';
Expand All @@ -8,6 +10,8 @@ import tracksTransactions from './utils/tracksTransactions';
const POSTGRES_MAX_INT = 2147483647;

export default class GovPollingService extends PrivateService {
polls;

constructor(name = 'govPolling') {
super(name, [
'smartContract',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@ import GovQueryApiService from './GovQueryApiService';
import EsmService from './EsmService';
import SpellService from './SpellService';

type ContractAddresses = {
kovan: { [key: string]: string };
mainnet: { [key: string]: string };
testnet?: { [key: string]: string };
};

export { MKR, IOU };

export default {
addConfig: function(config, { network = 'mainnet', staging = false }) {
const contractAddresses = {
const contractAddresses: ContractAddresses = {
kovan: require('../contracts/addresses/kovan.json'),
mainnet: require('../contracts/addresses/mainnet.json')
};
Expand Down
6 changes: 3 additions & 3 deletions packages/dai-plugin-governance/test/ChiefService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ beforeAll(async () => {
maker.useAccount('owner');
});

afterAll(async done => {
afterAll(async () => {
if (global.useOldChain) {
await restoreSnapshotOriginal(global.snapshotId);
done();
return;
} else {
global.client.restoreSnapshot(global.testchainId, global.defaultSnapshotId);
await sleep(15000);

await global.client.delete(global.testchainId);
await sleep(15000);

done();
return;
}
});

Expand Down
6 changes: 3 additions & 3 deletions packages/dai-plugin-governance/test/EsmService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ beforeAll(async () => {
await setUpAllowance(maker, esmService._esmContract().address);
});

afterAll(async done => {
afterAll(async () => {
if (global.useOldChain) {
await restoreSnapshotOriginal(global.snapshotId);
done();
return;
} else {
global.client.restoreSnapshot(global.testchainId, global.defaultSnapshotId);
await sleep(15000);

await global.client.delete(global.testchainId);
await sleep(15000);

done();
return;
}
});

Expand Down
6 changes: 3 additions & 3 deletions packages/dai-plugin-governance/test/GovPollingService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ beforeAll(async () => {
maker.useAccount('owner');
});

afterAll(async done => {
afterAll(async () => {
if (global.useOldChain) {
await restoreSnapshotOriginal(global.snapshotId);
done();
return;
} else {
global.client.restoreSnapshot(global.testchainId, global.defaultSnapshotId);
await sleep(15000);
await global.client.delete(global.testchainId);
await sleep(15000);
done();
return;
}
});

Expand Down
6 changes: 3 additions & 3 deletions packages/dai-plugin-governance/test/SpellService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import {

let maker, spellService;

afterAll(async done => {
afterAll(async () => {
if (global.useOldChain) {
await restoreSnapshotOriginal(global.snapshotId);
done();
return;
} else {
global.client.restoreSnapshot(global.testchainId, global.defaultSnapshotId);
await sleep(15000);

await global.client.delete(global.testchainId);
await sleep(15000);

done();
return;
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ beforeAll(async () => {
vdfs = maker.service('voteDelegateFactory');
});

afterAll(async done => {
afterAll(async () => {
await restoreSnapshotOriginal(global.snapshotId);
done();
return;
});

test('can create vote delegate factory service', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ beforeAll(async () => {
await vdfs.createDelegateContract();
});

afterAll(async done => {
afterAll(async () => {
await restoreSnapshotOriginal(global.snapshotId);
done();
return;
});

test('can create vote delegate service', async () => {
Expand Down
54 changes: 0 additions & 54 deletions packages/dai-plugin-governance/test/VoteProxy.test.js

This file was deleted.

Loading