Skip to content

Commit ca75064

Browse files
authored
Merge pull request #62 from polywrap/pileks/chore/wrapscan-uris
Common Bundle - use Wrapscan URIs
2 parents 6e19bd0 + 12d4f78 commit ca75064

File tree

56 files changed

+657
-719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+657
-719
lines changed

.github/workflows/ci-javascript.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,8 @@ jobs:
8080
- name: Build docs
8181
run: yarn build:docs
8282

83-
CI-WRAP-Test-Harness:
84-
uses: ./.github/workflows/ci-wrap-test-harness.yaml
85-
8683
Test:
8784
runs-on: ubuntu-latest
88-
needs: CI-WRAP-Test-Harness
8985
timeout-minutes: 60
9086
if: ${{ always() }}
9187
steps:
@@ -118,18 +114,5 @@ jobs:
118114
- name: Build
119115
run: yarn build
120116

121-
- name: Get updated wrappers
122-
if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }}
123-
uses: actions/download-artifact@v3
124-
id: get-wrappers
125-
with:
126-
name: rebuilt-wrappers
127-
path: ./wrappers
128-
129-
- if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }}
130-
run: |
131-
rm -rf packages/test-cases/wrappers
132-
mv wrappers packages/test-cases
133-
134117
- name: Test
135118
run: yarn test

.github/workflows/ci-wrap-test-harness.yaml

Lines changed: 0 additions & 118 deletions
This file was deleted.

WRAP_TEST_HARNESS

Lines changed: 0 additions & 1 deletion
This file was deleted.

integration-tests/react-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@polywrap/client-js": "~0.10.1",
7-
"@polywrap/sys-config-bundle-js": "~0.10.1",
6+
"@polywrap/client-js": "~0.12.0-pre.1",
7+
"@polywrap/sys-config-bundle-js": "~0.12.0-pre.1",
88
"@types/react": "^18.2.13",
99
"@types/react-dom": "^18.2.6",
1010
"react": "^18.2.0",

packages/client/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Invoke a wrapper.
4141

4242
```ts
4343
const result = await client.invoke({
44-
uri: "ens/helloworld.dev.polywrap.eth",
45-
method: "logMessage",
44+
uri: "wrapscan.io/polywrap/logging@1",
45+
method: "info",
4646
args: {
4747
message: "Hello World!"
4848
}

packages/client/examples/quickstart.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export async function invoke(): Promise<any> {
2323
const client = new PolywrapClient();
2424
// $start: quickstart-invoke
2525
const result = await client.invoke({
26-
uri: "ens/helloworld.dev.polywrap.eth",
27-
method: "logMessage",
26+
uri: "wrapscan.io/polywrap/logging@1",
27+
method: "info",
2828
args: {
2929
message: "Hello World!"
3030
}

packages/client/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"@polywrap/wrap-manifest-types-js": "0.12.0-pre.1"
3636
},
3737
"devDependencies": {
38-
"@polywrap/cli-js": "~0.10.0",
3938
"@polywrap/sys-config-bundle-js": "0.12.0-pre.1",
4039
"@polywrap/test-cases": "0.12.0-pre.1",
4140
"@types/jest": "29.5.0",
@@ -44,7 +43,6 @@
4443
"bignumber.js": "9.0.2",
4544
"doc-snippets": "~1.0.0",
4645
"jest": "29.5.0",
47-
"polywrap": "~0.10.0",
4846
"rimraf": "3.0.2",
4947
"ts-jest": "29.1.0",
5048
"ts-loader": "8.0.17",

packages/client/src/__tests__/core/error-structure.spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ describe("Error structure", () => {
8888
expect(result.error?.innerError instanceof WrapError).toBeTruthy();
8989
const prev = result.error?.innerError as WrapError;
9090
expect(prev.name).toEqual("WrapError");
91-
expect(prev.code).toEqual(WrapErrorCode.WRAPPER_INVOKE_ABORTED);
91+
expect(prev.code).toEqual(WrapErrorCode.URI_NOT_FOUND);
9292
expect(prev.reason).toContain(
93-
"A URI Resolver returned an error."
93+
"Unable to find URI wrap://authority/imported-invoke"
9494
);
95-
expect(prev.uri).toEqual("wrap://ens/wraps.eth:ens-uri-resolver-ext@1.0.1");
95+
expect(prev.uri).toEqual("wrap://authority/imported-invoke");
9696
});
9797

9898
describe("Wasm wrapper - Assemblyscript", () => {
@@ -165,8 +165,8 @@ describe("Error structure", () => {
165165
const config = new PolywrapClientConfigBuilder()
166166
.addDefaults()
167167
.setRedirects({
168-
"ens/imported-invoke.eth": asInvokeWrapperUri.uri,
169-
"ens/imported-subinvoke.eth": asSubinvokeWrapperUri.uri,
168+
"authority/imported-invoke": asInvokeWrapperUri.uri,
169+
"authority/imported-subinvoke": asSubinvokeWrapperUri.uri,
170170
})
171171
.build();
172172
const client = new PolywrapClient(config);
@@ -206,7 +206,7 @@ describe("Error structure", () => {
206206
expect(
207207
prev.reason.startsWith("SubInvocation exception encountered")
208208
).toBeTruthy();
209-
expect(prev.uri).toEqual("wrap://ens/imported-invoke.eth");
209+
expect(prev.uri).toEqual("wrap://authority/imported-invoke");
210210
expect(prev.method).toEqual("invokeThrowError");
211211
expect(prev.args).toEqual('{\n "a": "Hey"\n}' );
212212
expect(prev.source?.file).toEqual(
@@ -219,7 +219,7 @@ describe("Error structure", () => {
219219
expect(prevOfPrev.code).toEqual(WrapErrorCode.WRAPPER_INVOKE_ABORTED);
220220
expect(prevOfPrev.reason).toEqual("__wrap_abort: Hey");
221221
expect(
222-
prevOfPrev.uri.endsWith("wrap://ens/imported-subinvoke.eth")
222+
prevOfPrev.uri.endsWith("wrap://authority/imported-subinvoke")
223223
).toBeTruthy();
224224
expect(prevOfPrev.method).toEqual("subinvokeThrowError");
225225
expect(prev.args).toEqual('{\n "a": "Hey"\n}');
@@ -341,8 +341,8 @@ describe("Error structure", () => {
341341
const config = new PolywrapClientConfigBuilder()
342342
.addDefaults()
343343
.setRedirects({
344-
"ens/imported-invoke.eth": rsInvokeWrapperUri.uri,
345-
"ens/imported-subinvoke.eth": rsSubinvokeWrapperUri.uri,
344+
"authority/imported-invoke": rsInvokeWrapperUri.uri,
345+
"authority/imported-subinvoke": rsSubinvokeWrapperUri.uri,
346346
})
347347
.build();
348348

@@ -381,7 +381,7 @@ describe("Error structure", () => {
381381
expect(
382382
prev.reason.startsWith("SubInvocation exception encountered")
383383
).toBeTruthy();
384-
expect(prev.uri).toEqual("wrap://ens/imported-invoke.eth");
384+
expect(prev.uri).toEqual("wrap://authority/imported-invoke");
385385
expect(prev.method).toEqual("invokeThrowError");
386386
expect(prev.args).toEqual('{\n "a": "Hey"\n}');
387387
expect(prev.source?.file).toEqual("src/lib.rs");
@@ -392,7 +392,7 @@ describe("Error structure", () => {
392392
expect(prevOfPrev.code).toEqual(WrapErrorCode.WRAPPER_INVOKE_ABORTED);
393393
expect(prevOfPrev.reason).toEqual("__wrap_abort: Hey");
394394
expect(
395-
prevOfPrev.uri.endsWith("wrap://ens/imported-subinvoke.eth")
395+
prevOfPrev.uri.endsWith("wrap://authority/imported-subinvoke")
396396
).toBeTruthy();
397397
expect(prevOfPrev.method).toEqual("subinvokeThrowError");
398398
expect(prevOfPrev.args).toEqual('{\n "a": "Hey"\n}');

packages/client/src/__tests__/core/plugin-wrapper.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe("plugin-wrapper", () => {
3939
};
4040

4141
test("plugin map types", async () => {
42-
const implementationUri = Uri.from("wrap://ens/some-implementation.eth");
42+
const implementationUri = Uri.from("wrap://authority/some-implementation");
4343
const mockPlugin = mockMapPlugin();
4444
const client = new PolywrapClient({
4545
resolver: UriResolver.from([

packages/client/src/__tests__/core/sanity.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ describe("sanity", () => {
2424
});
2525

2626
test("validate requested uri is available", async () => {
27-
const subinvokeUri = Uri.from("ens/imported-subinvoke.eth");
28-
const invokeUri = Uri.from("ens/imported-invoke.eth");
29-
const consumerUri = Uri.from("ens/consumer.eth");
27+
const subinvokeUri = Uri.from("authority/imported-subinvoke");
28+
const invokeUri = Uri.from("authority/imported-invoke");
29+
const consumerUri = Uri.from("authority/consumer");
3030

3131
const getPackage = async (name: string) => {
3232
const manifest = await fs.promises.readFile(

0 commit comments

Comments
 (0)