Skip to content

Commit

Permalink
fix: Bump polkadot-js and adjust imports; Update specs (#344)
Browse files Browse the repository at this point in the history
* fix: Bump polkadot-js and adjust imports; Update specs

* Update u32 to no alias

* Adjust some imports

* Use tabs not spaces

* Fix linter complaints
  • Loading branch information
emostov committed Nov 17, 2020
1 parent db61ccb commit eeea29b
Show file tree
Hide file tree
Showing 32 changed files with 390 additions and 414 deletions.
55 changes: 28 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier/@typescript-eslint',
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json'
},
plugins: [
'@typescript-eslint',
'prettier',
'simple-import-sort'
],
rules: {
// Sort imports
'simple-import-sort/sort': 'error',
// https://github.com/eslint/eslint/issues/2321#issuecomment-134665757
'no-unused-vars': [2, { args: 'all', argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': [
2,
{ args: 'all', argsIgnorePattern: '^_' }
],
"@typescript-eslint/ban-types": 0,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier/@typescript-eslint',
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json'
},
plugins: [
'@typescript-eslint',
'prettier',
'simple-import-sort'
],
rules: {
// Sort imports
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
// https://github.com/eslint/eslint/issues/2321#issuecomment-134665757
'no-unused-vars': [2, { args: 'all', argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': [
2,
{ args: 'all', argsIgnorePattern: '^_' }
],
"@typescript-eslint/ban-types": 0,
},
};
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"test": "jest --silent"
},
"dependencies": {
"@polkadot/api": "^2.6.1",
"@polkadot/util-crypto": "^4.0.1",
"@polkadot/api": "^2.7.1",
"@polkadot/util-crypto": "^4.1.1",
"@substrate/calc": "^0.1.2",
"confmgr": "^1.0.6",
"express": "^4.17.1",
Expand All @@ -46,7 +46,7 @@
"winston": "^3.3.3"
},
"devDependencies": {
"@types/express": "^4.17.8",
"@types/express": "^4.17.9",
"@types/express-serve-static-core": "^4.17.13",
"@types/http-errors": "^1.6.3",
"@types/jest": "^26.0.15",
Expand All @@ -57,7 +57,7 @@
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-simple-import-sort": "^5.0.3",
"eslint-plugin-simple-import-sort": "^6.0.0",
"jest": "^26.6.3",
"prettier": "^2.1.2",
"rimraf": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/accounts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as AccountsStakingPayouts } from './AccountsStakingPayoutsController';
export { default as AccountsBalanceInfo } from './AccountsBalanceInfoController';
export { default as AccountsStakingInfo } from './AccountsStakingInfoController';
export { default as AccountsStakingPayouts } from './AccountsStakingPayoutsController';
export { default as AccountsVestingInfo } from './AccountsVestingInfoController';
6 changes: 3 additions & 3 deletions src/controllers/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './transaction';
export * from './accounts';
export * from './blocks';
export * from './runtime';
export * from './pallets';
export * from './node';
export * from './pallets';
export * from './runtime';
export * from './transaction';
2 changes: 1 addition & 1 deletion src/controllers/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { default as NodeNetwork } from './NodeNetworkController';
export { default as NodeVersion } from './NodeVersionController';
export { default as NodeTransactionPool } from './NodeTransactionPoolController';
export { default as NodeVersion } from './NodeVersionController';
2 changes: 1 addition & 1 deletion src/controllers/runtime/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { default as RuntimeCode } from './RuntimeCodeController';
export { default as RuntimeSpec } from './RuntimeSpecController';
export { default as RuntimeMetadata } from './RuntimeMetadataController';
export { default as RuntimeSpec } from './RuntimeSpecController';
2 changes: 1 addition & 1 deletion src/controllers/transaction/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as TransactionDryRun } from './TransactionDryRunController';
export { default as TransactionMaterial } from './TransactionMaterialController';
export { default as TransactionFeeEstimate } from './TransactionFeeEstimateController';
export { default as TransactionMaterial } from './TransactionMaterialController';
export { default as TransactionSubmit } from './TransactionSubmitController';
4 changes: 2 additions & 2 deletions src/logging/transformers/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './nodeUtilFormat';
export * from './stripTimestamp';
export * from './filterApiRpc';
export * from './nodeUtilFormat';
export * from './stripAnsi';
export * from './stripTimestamp';
export * from './timeStamp';
6 changes: 3 additions & 3 deletions src/middleware/error/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { txErrorMiddleware as txError } from './txErrorMiddleware';
export { httpErrorMiddleware as httpError } from './httpErrorMiddleware';
export { errorMiddleware as error } from './errorMiddleware';
export { legacyErrorMiddleware as legacyError } from './legacyErrorMiddleware';
export { httpErrorMiddleware as httpError } from './httpErrorMiddleware';
export { internalErrorMiddleware as internalError } from './internalErrorMiddleware';
export { legacyErrorMiddleware as legacyError } from './legacyErrorMiddleware';
export { txErrorMiddleware as txError } from './txErrorMiddleware';
8 changes: 4 additions & 4 deletions src/middleware/validate/validateAddressMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import checkChecksum from '@polkadot/util-crypto/address/checkChecksum';
import defaults from '@polkadot/util-crypto/address/defaults';
import base58Decode from '@polkadot/util-crypto/base58/decode';
import { checkAddressChecksum } from '@polkadot/util-crypto';
import { base58Decode } from '@polkadot/util-crypto';
import { defaults } from '@polkadot/util-crypto/address/defaults';
import { RequestHandler } from 'express';
import { BadRequest } from 'http-errors';

Expand Down Expand Up @@ -42,7 +42,7 @@ function checkAddress(address: string): [boolean, string | undefined] {
return [false, 'Invalid decoded address length'];
}

const [isValid] = checkChecksum(decoded);
const [isValid] = checkAddressChecksum(decoded);

return [isValid, isValid ? undefined : 'Invalid decoded address checksum'];
}
Loading

0 comments on commit eeea29b

Please sign in to comment.