Skip to content

Commit

Permalink
Merge branch 'master' into PR-to-origin
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed Jul 4, 2024
2 parents cc95f25 + b098abe commit 847237b
Show file tree
Hide file tree
Showing 34 changed files with 427 additions and 288 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# CHANGELOG

## 0.48.2 July 3, 2024

Contributed:

- Fix: forget account for legacy account without authorizedAccounts (Thanks to https://github.com/Tbaut)

Changes:

- Adjust ui imports for deterministic bundling


## 0.48.1 June 27, 2024

- **Important** Not published to the stores, aligns with latest released packages.

Changes:

- Bump @polkadot/api to 12.0.2
- NOTE: We are doing a minor bump because the api in this version now gives the option
to modify payloads for `signAndSend`, `signAsync`, and `dryRun` which the extension does not use. That being said, for any user that digests that package it will be available to use as a feature.
- Bump @polkadot/phishing to 0.22.10


## 0.47.6 June 18, 2024

Changes:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
634 Jaco 2024 (#1302)
91 Thibaut Sardan fix typos (#1343)
28 Tarik Gul 0.47.6 (#1374)
92 Thibaut Sardan Fix: forget account for legacy account without authorizedAccounts (#1381)
32 Tarik Gul 0.48.2 (#1384)
7 Ivan Rukhavets Mention derivation in FAQ (#334)
4 Amaury Martiny PostMessageProvider with on('connected' | 'disconnected') (#279)
3 Antoine Estienne Add eth test for extension signature (#909)
Expand Down
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,24 @@ Find out more about how to use the extension as a Dapp developper, cookbook, as
2. Run `corepack enable` [More information](https://github.com/nodejs/corepack?tab=readme-ov-file#corepack-enable--name)
2. Install dependencies via `yarn install`
3. Build all packages via `yarn build`
- The `/packages/extension/build` will contain the exact code used in the add-on
4. To regenerate the dst, and src compressed files run: `yarn build:zip`
- The `/packages/extension/build` directory will contain the exact code used in the add-on, and should exactly match the uncompressed `master-build`.

NOTE: If you would like to regenerate the compressed `master-build.zip`, and `master-src.zip` files run: `yarn build:zip`

## Ensuring `master-build` and `master-src` dont have any diffs (For maintainers)

Summary: These are the steps to ensure the following builds don't have any diffs so that the firefox review goes smoothly.

1. Run `yarn build`
2. Run `yarn build:zip` - This will generate a `master-build.zip`, and `master-src.zip`.
3. Move `master-src.zip`, and `master-build.zip` to its own enviornment/folder.
4. Uncompress `master-src.zip` to `master-zrc` and inside of `master-src` run `yarn && yarn build`.
5. Uncompress `master-build.zip` to `master-build`.
6. Now we can compare the two builds using `diff`, and `comm`
- Run `diff -qr <path-to-master-build>/master-build <path-to-master-src>/packages/extension/build | sort`
7. To sanity check important files (`background.js`, and `extension.js`) you can also run:
- `comm -23 <(sort <path-to-master-build>/background.js) <(sort <path-to-master-src>/packages/extension/build/background.js) > diff`
- `comm -23 <(sort <path-to-master-build>/extension.js) <(sort <path-to-master-src>/packages/extension/build/extension.js) > diff`

## Development version

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
},
"sideEffects": false,
"type": "module",
"version": "0.47.6",
"version": "0.48.2",
"versions": {
"git": "0.47.6",
"npm": "0.47.6"
"git": "0.48.2",
"npm": "0.48.2"
},
"workspaces": [
"packages/*"
Expand All @@ -44,10 +44,10 @@
"sinon-chrome": "^3.0.1"
},
"resolutions": {
"@polkadot/api": "^11.3.1",
"@polkadot/api": "^12.0.2",
"@polkadot/keyring": "^12.6.2",
"@polkadot/networks": "^12.6.2",
"@polkadot/types": "^11.3.1",
"@polkadot/types": "^12.0.2",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/x-fetch": "^12.6.2",
Expand Down
18 changes: 9 additions & 9 deletions packages/extension-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "0.47.6",
"version": "0.48.2",
"main": "index.js",
"dependencies": {
"@polkadot/api": "^11.3.1",
"@polkadot/extension-chains": "0.47.6",
"@polkadot/extension-dapp": "0.47.6",
"@polkadot/extension-inject": "0.47.6",
"@polkadot/api": "^12.0.2",
"@polkadot/extension-chains": "0.48.2",
"@polkadot/extension-dapp": "0.48.2",
"@polkadot/extension-inject": "0.48.2",
"@polkadot/keyring": "^12.6.2",
"@polkadot/networks": "^12.6.2",
"@polkadot/phishing": "^0.22.9",
"@polkadot/rpc-provider": "^11.3.1",
"@polkadot/types": "^11.3.1",
"@polkadot/phishing": "^0.22.10",
"@polkadot/rpc-provider": "^12.0.2",
"@polkadot/types": "^12.0.2",
"@polkadot/ui-keyring": "^3.6.6",
"@polkadot/ui-settings": "^3.6.6",
"@polkadot/util": "^12.6.2",
Expand All @@ -39,6 +39,6 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/extension-mocks": "0.47.6"
"@polkadot/extension-mocks": "0.48.2"
}
}
10 changes: 5 additions & 5 deletions packages/extension-base/src/background/handlers/Extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type State from './State.js';
import { ALLOWED_PATH, PASSWORD_EXPIRY_MS } from '@polkadot/extension-base/defaults';
import { metadataExpand } from '@polkadot/extension-chains';
import { TypeRegistry } from '@polkadot/types';
import keyring from '@polkadot/ui-keyring';
import { keyring } from '@polkadot/ui-keyring';
import { accounts as accountsObservable } from '@polkadot/ui-keyring/observable/accounts';
import { assert, isHex } from '@polkadot/util';
import { keyExtractSuri, mnemonicGenerate, mnemonicValidate } from '@polkadot/util-crypto';
Expand Down Expand Up @@ -121,11 +121,11 @@ export default class Extension {

// cycle through authUrls and prepare the array of diff
Object.entries(this.#state.authUrls).forEach(([url, urlInfo]) => {
if (!urlInfo.authorizedAccounts.includes(address)) {
return;
// Note that urlInfo.authorizedAccounts may be undefined if this website entry
// was created before the "account authorization per website" functionality was introduced
if (urlInfo.authorizedAccounts?.includes(address)) {
authorizedAccountsDiff.push([url, urlInfo.authorizedAccounts.filter((previousAddress) => previousAddress !== address)]);
}

authorizedAccountsDiff.push([url, urlInfo.authorizedAccounts.filter((previousAddress) => previousAddress !== address)]);
});

this.#state.updateAuthorizedAccounts(authorizedAccountsDiff);
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-base/src/background/handlers/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { BehaviorSubject } from 'rxjs';

import { addMetadata, knownMetadata } from '@polkadot/extension-chains';
import { knownGenesis } from '@polkadot/networks/defaults';
import settings from '@polkadot/ui-settings';
import { settings } from '@polkadot/ui-settings';
import { assert } from '@polkadot/util';

import { MetadataStore } from '../../stores/index.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-base/src/background/handlers/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { AuthResponse } from './State.js';
import type State from './State.js';

import { checkIfDenied } from '@polkadot/phishing';
import keyring from '@polkadot/ui-keyring';
import { keyring } from '@polkadot/ui-keyring';
import { accounts as accountsObservable } from '@polkadot/ui-keyring/observable/accounts';
import { assert, isNumber } from '@polkadot/util';

Expand Down
2 changes: 1 addition & 1 deletion packages/extension-base/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/extension-base', path: 'auto', type: 'auto', version: '0.47.6' };
export const packageInfo = { name: '@polkadot/extension-base', path: 'auto', type: 'auto', version: '0.48.2' };
4 changes: 2 additions & 2 deletions packages/extension-chains/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "0.47.6",
"version": "0.48.2",
"main": "index.js",
"dependencies": {
"@polkadot/extension-inject": "0.47.6",
"@polkadot/extension-inject": "0.48.2",
"@polkadot/networks": "^12.6.2",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-chains/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/extension-chains', path: 'auto', type: 'auto', version: '0.47.6' };
export const packageInfo = { name: '@polkadot/extension-chains', path: 'auto', type: 'auto', version: '0.48.2' };
6 changes: 3 additions & 3 deletions packages/extension-compat-metamask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "0.47.6",
"version": "0.48.2",
"main": "index.js",
"dependencies": {
"@metamask/detect-provider": "^2.0.0",
"@polkadot/extension-inject": "0.47.6",
"@polkadot/types": "^11.3.1",
"@polkadot/extension-inject": "0.48.2",
"@polkadot/types": "^12.0.2",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2",
"web3": "^4.7.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-compat-metamask/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/extension-compat-metamask', path: 'auto', type: 'auto', version: '0.47.6' };
export const packageInfo = { name: '@polkadot/extension-compat-metamask', path: 'auto', type: 'auto', version: '0.48.2' };
7 changes: 4 additions & 3 deletions packages/extension-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "0.47.6",
"version": "0.48.2",
"main": "index.js",
"dependencies": {
"@polkadot/extension-inject": "0.47.6",
"@polkadot/types": "12.0.1",
"@metamask/utils": "^9.0.0",
"@polkadot/extension-inject": "0.48.2",
"@polkadot/types": "12.1.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"tslib": "^2.6.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-dapp/src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { InjectedAccount, InjectedAccountWithMeta, InjectedExtension, Injec
import { isPromise, objectSpread, u8aEq } from '@polkadot/util';
import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';

import { SNAPS } from './snap/snapList.js';
import { injectedMetamaskSnap } from './snap/index.js';
import { SNAPS } from './snap/snapList.js';
import { hasMetamask } from './snap/utils.js';
import { documentReadyPromise } from './util.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/extension-dapp/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/extension-dapp', path: 'auto', type: 'auto', version: '0.47.6' };
export const packageInfo = { name: '@polkadot/extension-dapp', path: 'auto', type: 'auto', version: '0.48.2' };
Loading

0 comments on commit 847237b

Please sign in to comment.