@@ -1,5 +1,13 @@
|
||||
# CHANGELOG
|
||||
|
||||
## master
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust compilation output for `__internal__` class fields
|
||||
- Bump to `@polkadot/util` 12.1.1
|
||||
|
||||
|
||||
## 0.46.1 Apr 22, 2023
|
||||
|
||||
- **Important** Not published to the stores, aligns with latest released packages.
|
||||
|
||||
14
package.json
14
package.json
@@ -40,19 +40,19 @@
|
||||
"watch": "cd packages/extension && yarn polkadot-exec-webpack --config webpack.watch.cjs --mode development --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/dev": "^0.73.2",
|
||||
"@types/node": "^18.15.13",
|
||||
"@polkadot/dev": "^0.73.6",
|
||||
"@types/node": "^18.16.3",
|
||||
"i18next-scanner": "^4.2.0",
|
||||
"sinon-chrome": "^3.0.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"@polkadot/api": "^10.4.1",
|
||||
"@polkadot/keyring": "^12.0.1",
|
||||
"@polkadot/networks": "^12.0.1",
|
||||
"@polkadot/keyring": "^12.1.1",
|
||||
"@polkadot/networks": "^12.1.1",
|
||||
"@polkadot/types": "^10.4.1",
|
||||
"@polkadot/util": "^12.0.1",
|
||||
"@polkadot/util-crypto": "^12.0.1",
|
||||
"@polkadot/x-fetch": "^12.0.1",
|
||||
"@polkadot/util": "^12.1.1",
|
||||
"@polkadot/util-crypto": "^12.1.1",
|
||||
"@polkadot/x-fetch": "^12.1.1",
|
||||
"safe-buffer": "^5.2.1",
|
||||
"typescript": "^5.0.3"
|
||||
}
|
||||
|
||||
@@ -25,17 +25,17 @@
|
||||
"@polkadot/extension-chains": "0.46.1",
|
||||
"@polkadot/extension-dapp": "0.46.1",
|
||||
"@polkadot/extension-inject": "0.46.1",
|
||||
"@polkadot/keyring": "^12.0.1",
|
||||
"@polkadot/networks": "^12.0.1",
|
||||
"@polkadot/phishing": "^0.21.1",
|
||||
"@polkadot/keyring": "^12.1.1",
|
||||
"@polkadot/networks": "^12.1.1",
|
||||
"@polkadot/phishing": "^0.21.2",
|
||||
"@polkadot/rpc-provider": "^10.4.1",
|
||||
"@polkadot/types": "^10.4.1",
|
||||
"@polkadot/ui-keyring": "^3.2.1",
|
||||
"@polkadot/ui-settings": "^3.2.1",
|
||||
"@polkadot/util": "^12.0.1",
|
||||
"@polkadot/util-crypto": "^12.0.1",
|
||||
"@polkadot/ui-keyring": "^3.2.2",
|
||||
"@polkadot/ui-settings": "^3.2.2",
|
||||
"@polkadot/util": "^12.1.1",
|
||||
"@polkadot/util-crypto": "^12.1.1",
|
||||
"eventemitter3": "^5.0.0",
|
||||
"rxjs": "^7.8.0",
|
||||
"rxjs": "^7.8.1",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -33,7 +33,7 @@ export default abstract class BaseStore <T> {
|
||||
const entries = Object.entries(result);
|
||||
const map: Record<string, T> = {};
|
||||
|
||||
for (let i = 0; i < entries.length; i++) {
|
||||
for (let i = 0, count = entries.length; i < count; i++) {
|
||||
const [key, value] = entries[i];
|
||||
|
||||
if (key.startsWith(this.#prefix)) {
|
||||
@@ -45,30 +45,30 @@ export default abstract class BaseStore <T> {
|
||||
});
|
||||
}
|
||||
|
||||
public get (_key: string, update: (value: T) => void): void {
|
||||
const key = `${this.#prefix}${_key}`;
|
||||
public get (key: string, update: (value: T) => void): void {
|
||||
const prefixedKey = `${this.#prefix}${key}`;
|
||||
|
||||
chrome.storage.local.get([key], (result: StoreValue): void => {
|
||||
chrome.storage.local.get([prefixedKey], (result: StoreValue): void => {
|
||||
lastError('get');
|
||||
|
||||
update(result[key] as T);
|
||||
update(result[prefixedKey] as T);
|
||||
});
|
||||
}
|
||||
|
||||
public remove (_key: string, update?: () => void): void {
|
||||
const key = `${this.#prefix}${_key}`;
|
||||
public remove (key: string, update?: () => void): void {
|
||||
const prefixedKey = `${this.#prefix}${key}`;
|
||||
|
||||
chrome.storage.local.remove(key, (): void => {
|
||||
chrome.storage.local.remove(prefixedKey, (): void => {
|
||||
lastError('remove');
|
||||
|
||||
update && update();
|
||||
});
|
||||
}
|
||||
|
||||
public set (_key: string, value: T, update?: () => void): void {
|
||||
const key = `${this.#prefix}${_key}`;
|
||||
public set (key: string, value: T, update?: () => void): void {
|
||||
const prefixedKey = `${this.#prefix}${key}`;
|
||||
|
||||
chrome.storage.local.set({ [key]: value }, (): void => {
|
||||
chrome.storage.local.set({ [prefixedKey]: value }, (): void => {
|
||||
lastError('set');
|
||||
|
||||
update && update();
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/extension-inject": "0.46.1",
|
||||
"@polkadot/networks": "^12.0.1",
|
||||
"@polkadot/util": "^12.0.1",
|
||||
"@polkadot/util-crypto": "^12.0.1",
|
||||
"@polkadot/networks": "^12.1.1",
|
||||
"@polkadot/util": "^12.1.1",
|
||||
"@polkadot/util-crypto": "^12.1.1",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"@metamask/detect-provider": "^1.2.0",
|
||||
"@polkadot/extension-inject": "0.46.1",
|
||||
"@polkadot/types": "^10.4.1",
|
||||
"@polkadot/util": "^12.0.1",
|
||||
"@polkadot/util": "^12.1.1",
|
||||
"tslib": "^2.5.0",
|
||||
"web3": "^1.9.0"
|
||||
},
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@polkadot/extension-inject": "0.46.1",
|
||||
"@polkadot/util": "^12.0.1",
|
||||
"@polkadot/util-crypto": "^12.0.1",
|
||||
"@polkadot/util": "^12.1.1",
|
||||
"@polkadot/util-crypto": "^12.1.1",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"dependencies": {
|
||||
"@polkadot/rpc-provider": "^10.4.1",
|
||||
"@polkadot/types": "^10.4.1",
|
||||
"@polkadot/util": "^12.0.1",
|
||||
"@polkadot/util-crypto": "^12.0.1",
|
||||
"@polkadot/x-global": "^12.0.1",
|
||||
"@polkadot/util": "^12.1.1",
|
||||
"@polkadot/util-crypto": "^12.1.1",
|
||||
"@polkadot/x-global": "^12.1.1",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chrome": "^0.0.233",
|
||||
"@types/chrome": "^0.0.234",
|
||||
"@types/firefox-webext-browser": "^111.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
30
packages/extension-inject/src/cyrb53.spec.ts
Normal file
30
packages/extension-inject/src/cyrb53.spec.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright 2019-2023 @polkadot/extension-inject authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@polkadot/dev-test/globals" />
|
||||
|
||||
import { cyrb53 } from './cyrb53.js';
|
||||
|
||||
const TESTS = [
|
||||
{ input: 'a', seed: 0, test: '501c2ba782c97901' },
|
||||
{ input: 'b', seed: 0, test: '459eda5bc254d2bf' },
|
||||
{ input: 'revenge', seed: 0, test: 'fbce64cc3b748385' },
|
||||
{ input: 'revenue', seed: 0, test: 'fb1d85148d13f93a' },
|
||||
{ input: 'revenue', seed: 1, test: '76fee5e6598ccd5c' },
|
||||
{ input: 'revenue', seed: 2, test: '1f672e2831253862' },
|
||||
{ input: 'revenue', seed: 3, test: '2b10de31708e6ab7' }
|
||||
] as const;
|
||||
|
||||
describe('cyrb53', (): void => {
|
||||
for (let i = 0, count = TESTS.length; i < count; i++) {
|
||||
const { input, seed, test } = TESTS[i];
|
||||
|
||||
it(`correctly encodes ${input}`, (): void => {
|
||||
// expected values, known input & seed
|
||||
expect(cyrb53(input, seed)).toEqual(test);
|
||||
|
||||
// seed set as Date.now(), should not match previous
|
||||
expect(cyrb53(input)).not.toEqual(test);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -10,7 +10,7 @@
|
||||
// As shared in https://stackoverflow.com/a/52171480
|
||||
//
|
||||
// Small changes made to the code as linked above:
|
||||
// . - Seed value is required (set as Date.now() in usage, could change)
|
||||
// - Seed value is required (set as Date.now() in usage, could change)
|
||||
// - Return value is a hex string (as per comment in SO answer)
|
||||
// - TS typings added
|
||||
// - Non-intrusive coding-style variable declaration changes
|
||||
@@ -18,7 +18,7 @@ export function cyrb53 (input: string, seed = Date.now()): string {
|
||||
let h1 = 0xdeadbeef ^ seed;
|
||||
let h2 = 0x41c6ce57 ^ seed;
|
||||
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
for (let i = 0, count = input.length; i < count; i++) {
|
||||
const ch = input.charCodeAt(i);
|
||||
|
||||
h1 = Math.imul(h1 ^ ch, 2654435761);
|
||||
|
||||
@@ -26,27 +26,27 @@
|
||||
"@polkadot/extension-chains": "0.46.1",
|
||||
"@polkadot/extension-dapp": "0.46.1",
|
||||
"@polkadot/extension-inject": "0.46.1",
|
||||
"@polkadot/hw-ledger": "^12.0.1",
|
||||
"@polkadot/keyring": "^12.0.1",
|
||||
"@polkadot/networks": "^12.0.1",
|
||||
"@polkadot/react-identicon": "^3.2.1",
|
||||
"@polkadot/react-qr": "^3.2.1",
|
||||
"@polkadot/hw-ledger": "^12.1.1",
|
||||
"@polkadot/keyring": "^12.1.1",
|
||||
"@polkadot/networks": "^12.1.1",
|
||||
"@polkadot/react-identicon": "^3.2.2",
|
||||
"@polkadot/react-qr": "^3.2.2",
|
||||
"@polkadot/types": "^10.4.1",
|
||||
"@polkadot/types-augment": "^10.4.1",
|
||||
"@polkadot/ui-keyring": "^3.2.1",
|
||||
"@polkadot/ui-settings": "^3.2.1",
|
||||
"@polkadot/util": "^12.0.1",
|
||||
"@polkadot/util-crypto": "^12.0.1",
|
||||
"@polkadot/ui-keyring": "^3.2.2",
|
||||
"@polkadot/ui-settings": "^3.2.2",
|
||||
"@polkadot/util": "^12.1.1",
|
||||
"@polkadot/util-crypto": "^12.1.1",
|
||||
"file-saver": "^2.0.5",
|
||||
"i18next": "^22.4.15",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-dropzone": "^11.7.1",
|
||||
"react-i18next": "^12.2.0",
|
||||
"react-i18next": "^12.2.2",
|
||||
"react-is": "^18.2.0",
|
||||
"react-router": "^5.3.4",
|
||||
"react-router-dom": "^5.3.4",
|
||||
"styled-components": "^5.3.9",
|
||||
"styled-components": "^5.3.10",
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -55,7 +55,7 @@
|
||||
"@types/enzyme-adapter-react-16": "^1.0.6",
|
||||
"@types/file-saver": "^2.0.5",
|
||||
"@types/react-copy-to-clipboard": "^5.0.4",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@types/react-dom": "^18.2.1",
|
||||
"@types/react-router": "^5.1.20",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@types/sinon-chrome": "^2.2.11",
|
||||
|
||||
@@ -11,13 +11,14 @@ export { default as Button } from './Button.js';
|
||||
export { default as ButtonArea } from './ButtonArea.js';
|
||||
export { default as ButtonWithSubtitle } from './ButtonWithSubtitle.js';
|
||||
export { default as Checkbox } from './Checkbox.js';
|
||||
export * from './contexts.js';
|
||||
export { default as Dropdown } from './Dropdown.js';
|
||||
export { default as ErrorBoundary } from './ErrorBoundary.js';
|
||||
export { default as Icon } from './Icon.js';
|
||||
export { default as Identicon } from './Identicon.js';
|
||||
export { default as InputFileWithLabel } from './InputFileWithLabel.js';
|
||||
export { default as InputFilter } from './InputFilter.js';
|
||||
export { default as InputWithLabel } from './InputWithLabel.js';
|
||||
export { default as InputFileWithLabel } from './InputFileWithLabel.js';
|
||||
export { default as Label } from './Label.js';
|
||||
export { default as Link } from './Link.js';
|
||||
export { default as List } from './List.js';
|
||||
@@ -34,12 +35,9 @@ export { default as Svg } from './Svg.js';
|
||||
export { default as Switch } from './Switch.js';
|
||||
export { default as Table } from './Table.js';
|
||||
export { default as TextAreaWithLabel } from './TextAreaWithLabel.js';
|
||||
export { Input, TextArea } from './TextInputs.js';
|
||||
export * from './themes.js';
|
||||
export { default as ValidatedInput } from './ValidatedInput.js';
|
||||
export { default as VerticalSpace } from './VerticalSpace.js';
|
||||
export { default as View } from './View.js';
|
||||
export { default as Warning } from './Warning.js';
|
||||
|
||||
export { Input, TextArea } from './TextInputs.js';
|
||||
|
||||
export * from './contexts.js';
|
||||
export * from './themes.js';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2019-2023 @polkadot/extension-ui authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as AccountSelection } from './AccountSelection.js';
|
||||
export { default as Header } from './Header.js';
|
||||
export { default as HeaderWithSteps } from './HeaderWithSteps.js';
|
||||
export { default as MenuSettings } from './MenuSettings.js';
|
||||
export { default as Name } from './Name.js';
|
||||
export { default as Password } from './Password.js';
|
||||
export { default as HeaderWithSteps } from './HeaderWithSteps.js';
|
||||
export { default as AccountSelection } from './AccountSelection.js';
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"tslib": "^2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/dev": "^0.73.2",
|
||||
"@polkadot/dev": "^0.73.6",
|
||||
"browser-resolve": "^2.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
|
||||
Reference in New Issue
Block a user