Skip to content

Commit

Permalink
Merge pull request #4573 from WalletConnect/fix/error-msg-on-metadata…
Browse files Browse the repository at this point in the history
…-validation

fix: url validation message
  • Loading branch information
ganchoradkov authored May 29, 2024
2 parents 8c447a9 + c21a7d5 commit c1751c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sign-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class SignClient extends ISignClient {
throw new Error("description is required value in metadata");
}
if (!metadata.url) {
throw new Error("description is required value in metadata");
throw new Error("url is required value in metadata");
}
}

Expand Down
13 changes: 13 additions & 0 deletions packages/sign-client/test/sdk/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ describe("Sign Client Integration", () => {
}),
).rejects.toThrowError("description is required value in metadata");
});
it("should not initialize with invalid metadata url", async () => {
await expect(
SignClient.init({
...TEST_SIGN_CLIENT_OPTIONS,
metadata: {
...TEST_INVALID_METADATA,
description: "description",
},
name: "init",
signConfig: { disableRequestQueue: true },
}),
).rejects.toThrowError("url is required value in metadata");
});

describe("connect", () => {
it("connect (with new pairing)", async () => {
Expand Down

0 comments on commit c1751c0

Please sign in to comment.