Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit dd1fc7d

Browse files
committed
fix: TS related issues after updating TS to a supported version
1 parent 28927bf commit dd1fc7d

File tree

6 files changed

+74
-223
lines changed

6 files changed

+74
-223
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"eslint": "eslint 'ts/**/*.{ts,tsx}'",
1818
"lint": "tslint --format stylish --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
1919
"fix": "yarn lint --fix",
20-
"pre_push": "yarn lint:prettier && yarn lint && yarn test",
20+
"pre_push": "yarn typecheck && yarn lint:prettier && yarn lint && yarn test",
2121
"update:tools": "aws s3 sync --delete s3://docs-markdown/ mdx/tools/ --profile $(npm config get awscli_profile)",
2222
"dev": "npm run update:tools && node --max-old-space-size=16384 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --content-base public",
2323
"deploy_dogfood": "npm run update:tools && yarn index_docs --environment dogfood && npm run build:prod && aws s3 sync ./public/. s3://dogfood.0xproject.com --profile $(npm config get awscli_profile) --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers && ./cdn-cache-clear.sh dogfood",
@@ -38,7 +38,7 @@
3838
"@0x/contract-addresses": "^4.1.0",
3939
"@0x/contract-wrappers": "^13.18.0",
4040
"@0x/contracts-dev-utils": "^1.0.2",
41-
"@0x/contracts-treasury": "^1.0.2",
41+
"@0x/contracts-treasury": "^1.4.2",
4242
"@0x/json-schemas": "^6.4.0",
4343
"@0x/order-utils": "^10.0.1",
4444
"@0x/subproviders": "^6.6.1",
@@ -125,7 +125,7 @@
125125
"sass-loader": "^7.1.0",
126126
"semver": "5.5.0",
127127
"semver-sort": "0.0.4",
128-
"styled-components": "^5.0.0",
128+
"styled-components": "^5.3.1",
129129
"thenby": "^1.2.3",
130130
"truffle-contract": "2.0.1",
131131
"urql": "^2.0.4",
@@ -169,7 +169,7 @@
169169
"@types/react-syntax-highlighter": "^10.2.1",
170170
"@types/react-transition-group": "^4.2.0",
171171
"@types/redux": "^3.6.0",
172-
"@types/styled-components": "4.1.1",
172+
"@types/styled-components": "^5.1.15",
173173
"@types/valid-url": "^1.0.2",
174174
"@types/web3-provider-engine": "^14.0.0",
175175
"@types/yargs": "^11.0.0",
@@ -206,7 +206,7 @@
206206
"ts-node": "^8.3.0",
207207
"tslint": "5.11.0",
208208
"tslint-config-0xproject": "^0.0.2",
209-
"typescript": "^3.7.4",
209+
"typescript": "^3.8.3",
210210
"unist-util-find-after": "^2.0.4",
211211
"unist-util-modify-children": "^1.1.4",
212212
"unist-util-select": "^2.0.2",

ts/blockchain.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ export class Blockchain {
622622
const provider = this._contractWrappers.getProvider();
623623
const web3Wrapper = new Web3Wrapper(provider);
624624
const exchangeAbi = this._contractWrappers.exchange.abi;
625-
web3Wrapper.abiDecoder.addABI(exchangeAbi);
625+
web3Wrapper.abiDecoder.addABI(exchangeAbi as any);
626626
const receipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
627627
return receipt;
628628
}
@@ -935,9 +935,9 @@ export class Blockchain {
935935
}
936936
private async _updateDefaultGasPriceAsync(): Promise<void> {
937937
try {
938-
const localStorageSpeed = localStorage.getItem('gas-speed');
939-
const { gasPriceInWei } = await backendClient.getGasInfoAsync(localStorageSpeed || 'standard');
940-
this._defaultGasPrice = gasPriceInWei;
938+
const { price } = await backendClient.getGasInfoAsync('standard');
939+
// HACK: this is not supporting EIP1559 but this file is legacy and not used anywhere
940+
this._defaultGasPrice = new BigNumber(price);
941941
} catch (err) {
942942
return;
943943
}

ts/pages/mesh/mesh_stats.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const fetchOrders = async () => fetchUtils.requestAsync(ordersBaseUrl, ordersPat
2828
export const MeshStats: React.FC = () => {
2929
const [meshFetchedSnapshot, setMeshSnapshot] = useState<{ meshNodes: MeshNodeMetaData[] }>();
3030
const [meshData, setMeshData] = useState<{ numActiveNodes: number; numEdges: number }>();
31-
const [orders, setOrders] = useState();
31+
const [orders, setOrders] = useState<{ total: number }>();
3232

3333
const [nodeDetails, setNodeDetails] = useState<{ data?: MeshNodeMetaData; isVisible: boolean }>({
3434
data: undefined,

ts/style/theme.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@ export interface IThemeInterface {
2727
}
2828

2929
// tslint:disable:no-unnecessary-type-assertion
30-
const {
31-
default: styled,
32-
css,
33-
createGlobalStyle,
34-
keyframes,
35-
ThemeProvider,
36-
} = styledComponents as styledComponents.ThemedStyledComponentsModule<IThemeInterface>;
30+
const { default: styled, css, createGlobalStyle, keyframes, ThemeProvider } = styledComponents;
3731
// tslint:enable:no-unnecessary-type-assertion
3832

3933
export { styled, css, createGlobalStyle, keyframes, ThemeProvider };

ts/utils/order_utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const orderHashUtils = {
4848
// format, we only assert that we were indeed passed a string.
4949
assert.isString('orderHash', orderHash);
5050
const schemaValidator = new SchemaValidator();
51-
const isValid = schemaValidator.validate(orderHash, schemas.orderHashSchema).valid;
51+
const isValid = schemaValidator.isValid(orderHash, schemas.orderHashSchema);
5252
return isValid;
5353
},
5454

0 commit comments

Comments
 (0)