Skip to content

Commit

Permalink
fix(types): Update @polkadot/{apps-config, api} to get latest chain t…
Browse files Browse the repository at this point in the history
…ypes (#434)
  • Loading branch information
emostov committed Feb 15, 2021
1 parent 081b8b3 commit e02818f
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 205 deletions.
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": "^3.8.1",
"@polkadot/apps-config": "^0.79.1",
"@polkadot/api": "^3.9.2",
"@polkadot/apps-config": "^0.80.1",
"@polkadot/util-crypto": "^5.6.2",
"@substrate/calc": "^0.2.0",
"confmgr": "^1.0.6",
Expand All @@ -53,8 +53,8 @@
"@types/jest": "^26.0.20",
"@types/morgan": "^1.9.2",
"@types/triple-beam": "^1.3.2",
"@typescript-eslint/eslint-plugin": "4.15.0",
"@typescript-eslint/parser": "4.15.0",
"@typescript-eslint/eslint-plugin": "4.15.1",
"@typescript-eslint/parser": "4.15.1",
"eslint": "^7.19.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-prettier": "^3.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function main() {
: apps.typesChain,
typesSpec: TYPES_SPEC
? (require(TYPES_SPEC) as Record<string, RegistryTypes>)
: apps.typesSpec,
: undefined,
types: TYPES ? (require(TYPES) as RegistryTypes) : undefined,
/* eslint-enable @typescript-eslint/no-var-requires */
});
Expand Down
12 changes: 6 additions & 6 deletions src/sanitize/sanitizeNumbers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ describe('sanitizeNumbers', () => {

describe('Result', () => {
const ResultConstructor = Result.with({
Error: 'Text',
Err: 'Text',
Ok: 'u128',
});
const message = kusamaRegistry.createType('Text', 'message');
Expand All @@ -652,10 +652,10 @@ describe('sanitizeNumbers', () => {
// });
it('converts Error(u128)', () => {
const error = new ResultConstructor(kusamaRegistry, {
Error: maxU128,
Err: maxU128,
});
expect(sanitizeNumbers(error)).toStrictEqual({
Error: MAX_U128,
Err: MAX_U128,
});
});

Expand All @@ -667,10 +667,10 @@ describe('sanitizeNumbers', () => {
// });
it('handles Error(Text)', () => {
const error = new ResultConstructor(kusamaRegistry, {
Error: message,
Err: message,
});
expect(sanitizeNumbers(error)).toStrictEqual({
Error: message.toString(),
Err: message.toString(),
});
});

Expand All @@ -697,7 +697,7 @@ describe('sanitizeNumbers', () => {
// expect(sanitizeNumbers(ok)).toBe(message.toString());
// });
it('handles Ok(Text)', () => {
const R = Result.with({ Error: 'Text', Ok: 'Text' });
const R = Result.with({ Err: 'Text', Ok: 'Text' });
const ok = new R(kusamaRegistry, {
Ok: message,
});
Expand Down
Loading

0 comments on commit e02818f

Please sign in to comment.