Skip to content

Commit

Permalink
update smoldot discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanleecode committed Jul 10, 2024
1 parent c2caf22 commit 8fab19f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 88 deletions.
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@polkadot/extension-inject": "0.48.3-2-x",
"@polkadot/extension-ui": "0.48.3-2-x",
"@substrate/light-client-extension-helpers": "^2.0.2",
"@substrate/smoldot-discovery": "^0.0.6",
"@substrate/smoldot-discovery": "^0.0.7",
"smoldot": "^2.0.29",
"tslib": "^2.6.2"
},
Expand Down
79 changes: 0 additions & 79 deletions packages/extension/src/connector.ts

This file was deleted.

7 changes: 4 additions & 3 deletions packages/extension/src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { MESSAGE_ORIGIN_CONTENT } from '@polkadot/extension-base/defaults';
import { enable, handleResponse, redirectIfPhishing } from '@polkadot/extension-base/page';
import { injectExtension } from '@polkadot/extension-inject';

import { createScClient } from './connector.js';
import { connector } from "@substrate/smoldot-discovery"

Check failure on line 14 in packages/extension/src/page.ts

View workflow job for this annotation

GitHub Actions / pr (lint)

Strings must use singlequote

Check failure on line 14 in packages/extension/src/page.ts

View workflow job for this annotation

GitHub Actions / pr (lint)

Missing semicolon
import { CHANNEL_ID } from './constants.js';
import { packageInfo } from './packageInfo.js';

Expand All @@ -26,7 +26,8 @@ const lightClientProvider = getLightClientProvider(CHANNEL_ID);

// #region Smoldot Discovery Provider
{
const provider = lightClientProvider.then(createScClient);
const provider = lightClientProvider
.then((provider) => connector.make({ lightClientProvider: provider }));

const detail: SmoldotExtensionProviderDetail = Object.freeze({
kind: 'smoldot-v1',
Expand All @@ -47,7 +48,7 @@ const lightClientProvider = getLightClientProvider(CHANNEL_ID);
}
// #endregion

function inject () {
function inject() {

Check failure on line 51 in packages/extension/src/page.ts

View workflow job for this annotation

GitHub Actions / pr (lint)

Missing space before function parentheses
injectExtension(enable, {
name: 'polkadot-js',
version: packageInfo.version
Expand Down
12 changes: 7 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ __metadata:
"@polkadot/extension-inject": "npm:0.48.3-2-x"
"@polkadot/extension-ui": "npm:0.48.3-2-x"
"@substrate/light-client-extension-helpers": "npm:^2.0.2"
"@substrate/smoldot-discovery": "npm:^0.0.6"
"@substrate/smoldot-discovery": "npm:^0.0.7"
browser-resolve: "npm:^2.0.0"
buffer: "npm:^6.0.3"
copy-webpack-plugin: "npm:^11.0.0"
Expand Down Expand Up @@ -1987,12 +1987,14 @@ __metadata:
languageName: node
linkType: hard

"@substrate/smoldot-discovery@npm:^0.0.6":
version: 0.0.6
resolution: "@substrate/smoldot-discovery@npm:0.0.6"
"@substrate/smoldot-discovery@npm:^0.0.7":
version: 0.0.7
resolution: "@substrate/smoldot-discovery@npm:0.0.7"
dependencies:
"@substrate/discovery": "npm:^0.0.1"
checksum: 10/4147035c86f7331dc8095a82c0ff1223a4bb9cc2ebe266e2ac5398d53f1d1b655ce3ee17499bfddd2b49bae082a3ca279e93f2787374dabd85d318c5cf0fe188
peerDependencies:
"@substrate/light-client-extension-helpers": ^2
checksum: 10/e13be406980cd74c48910285b991acc17411ad0289cdcebec9f073d93dddd11cd65527ba6c518e56e0103e89fa3286f3431b7efca8bd35863be6479faf6a3561
languageName: node
linkType: hard

Expand Down

0 comments on commit 8fab19f

Please sign in to comment.