Skip to content

Commit 62affb7

Browse files
committed
chore: remove usage of ens URIs
1 parent 8caeb1b commit 62affb7

File tree

20 files changed

+243
-259
lines changed

20 files changed

+243
-259
lines changed

WRAP_TEST_HARNESS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
master
1+
wrapscan-updates

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/src/__tests__/core/error-structure.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe("Error structure", () => {
9292
expect(prev.reason).toContain(
9393
"A URI Resolver returned an error."
9494
);
95-
expect(prev.uri).toEqual("wrap://ens/wraps.eth:ens-uri-resolver-ext@1.0.1");
95+
expect(prev.uri).toEqual("wrapscan.io/polywrap/ens-uri-resolver@1.0.0");
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(

packages/client/src/__tests__/core/type-test-cases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const typeTestCases = (implementation: string) => {
1212
const config = new PolywrapClientConfigBuilder()
1313
.addDefaults()
1414
.setPackage(
15-
"wrap://ens/memory-storage.polywrap.eth",
15+
"wrap://plugin/memory-storage",
1616
memoryStoragePlugin()
1717
)
1818
.build();

packages/client/src/__tests__/core/uri-resolution.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const expectResolutionResult = async (
2929

3030
describe("URI resolution", () => {
3131
it("sanity", async () => {
32-
const uri = new Uri("ens/wraps.eth:uri-resolver-ext@1.1.0");
32+
const uri = new Uri("wrapscan.io/polywrap/uri-resolver@1.0.0");
3333

3434
const client = new PolywrapClient();
3535

@@ -51,8 +51,8 @@ describe("URI resolution", () => {
5151
});
5252

5353
it("can resolve uri with custom resolver", async () => {
54-
const fromUri = new Uri(`test/from.eth`);
55-
const redirectUri = new Uri(`test/to.eth`);
54+
const fromUri = new Uri(`test/from`);
55+
const redirectUri = new Uri(`test/to`);
5656

5757
const config = new PolywrapClientConfigBuilder()
5858
.addDefaults()

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ describe("wasm-wrapper", () => {
8484
it("should invoke wrapper with custom redirects", async () => {
8585
const config = new PolywrapClientConfigBuilder()
8686
.addDefaults()
87-
.setRedirect(wrapperUri.uri, "wrap://ens/mock.polywrap.eth")
88-
.setPackage("wrap://ens/mock.polywrap.eth", mockPlugin())
87+
.setRedirect(wrapperUri.uri, "wrap://authority/mock.polywrap")
88+
.setPackage("wrap://authority/mock.polywrap", mockPlugin())
8989
.build();
9090
const client = new PolywrapClient(config);
9191

@@ -104,7 +104,7 @@ describe("wasm-wrapper", () => {
104104
it("should allow clone + reconfigure of redirects", async () => {
105105
let builder = new PolywrapClientConfigBuilder()
106106
.add({
107-
packages: { "wrap://ens/mock.polywrap.eth": mockPlugin() },
107+
packages: { "wrap://authority/mock.polywrap": mockPlugin() },
108108
})
109109
.addDefaults();
110110

@@ -122,7 +122,7 @@ describe("wasm-wrapper", () => {
122122
expect(clientResult).toEqual(ResultOk(2));
123123

124124
const redirects = {
125-
[wrapperUri.uri]: "wrap://ens/mock.polywrap.eth",
125+
[wrapperUri.uri]: "wrap://authority/mock.polywrap",
126126
};
127127

128128
builder = builder.add({ redirects });
@@ -164,12 +164,12 @@ describe("wasm-wrapper", () => {
164164

165165
const pluginClient = new PolywrapClient({
166166
resolver: UriResolver.from([
167-
mockPluginRegistration("ens/mock-plugin.eth"),
167+
mockPluginRegistration("authority/mock-plugin"),
168168
]),
169169
});
170170

171171
let pluginGetFileResult = await pluginClient.getFile(
172-
"ens/mock-plugin.eth",
172+
"authority/mock-plugin",
173173
{
174174
path: "./index.js",
175175
}

packages/client/src/__tests__/core/wrap-features/env-case.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,29 +554,29 @@ export const envTestCases = (implementation: string) => {
554554

555555
describe("env client types", () => {
556556
test("plugin env types", async () => {
557-
const implementationUri = Uri.from("wrap://ens/some-implementation.eth");
558-
const envPlugin = mockPluginRegistration("ens/hello.eth");
557+
const implementationUri = Uri.from("wrap://authority/some-implementation");
558+
const envPlugin = mockPluginRegistration("authority/hello");
559559
const client = new PolywrapClient({
560560
resolver: RecursiveResolver.from([
561561
{
562562
uri: envPlugin.uri,
563563
package: envPlugin.package,
564564
},
565-
{ from: Uri.from("ens/hello.eth"), to: implementationUri },
565+
{ from: Uri.from("authority/hello"), to: implementationUri },
566566
]),
567-
envs: new UriMap([[Uri.from("wrap://ens/hello.eth"), { arg1: "10" }]]),
567+
envs: new UriMap([[Uri.from("wrap://authority/hello"), { arg1: "10" }]]),
568568
});
569569

570570
const mockEnv = await client.invoke({
571-
uri: Uri.from("ens/hello.eth"),
571+
uri: Uri.from("authority/hello"),
572572
method: "mockEnv",
573573
});
574574

575575
expect(mockEnv).toMatchObject(ResultOk({ arg1: "10" }));
576576
});
577577

578578
test("inline plugin env types", async () => {
579-
const implementationUri = "wrap://ens/some-implementation.eth";
579+
const implementationUri = "wrap://authority/some-implementation";
580580
interface MockEnv extends Record<string, unknown> {
581581
arg1: number;
582582
}

0 commit comments

Comments
 (0)