Skip to content

Commit

Permalink
Remove deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
w4ll3 committed Dec 2, 2024
1 parent 3ceee36 commit 5c8388c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
12 changes: 1 addition & 11 deletions packages/siwe/lib/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,7 @@ describe(`Message verification without suppressExceptions`, () => {
domain: (test_fields as any).domainBinding,
nonce: (test_fields as any).matchNonce,
})
// when validate is removed uncomment this and remove the following then
// .then(({ success }) => success)
.then(async ({ data }) => {
jest
.useFakeTimers()
.setSystemTime(
new Date((test_fields as any).time || test_fields.issuedAt)
);
const res = await msg.validate(test_fields.signature);
return res === data;
})
.then(({ success }) => success)
).resolves.toBeTruthy();

jest.useRealTimers();
Expand Down
17 changes: 0 additions & 17 deletions packages/siwe/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,6 @@ export class SiweMessage {
return message;
}

/**
* @deprecated
* Verifies the integrity of the object by matching its signature.
* @param signature Signature to match the address in the message.
* @param provider Ethers provider to be used for EIP-1271 validation
*/
async validate(signature: string, provider?: Provider) {
console.warn(
'validate() has been deprecated, please update your code to use verify(). validate() may be removed in future versions.'
);
return this.verify({ signature }, { provider, suppressExceptions: false })
.then(({ data }) => data)
.catch(({ error }) => {
throw error;
});
}

/**
* Verifies the integrity of the object by matching its signature.
* @param params Parameters to verify the integrity of the message, signature is required.
Expand Down

0 comments on commit 5c8388c

Please sign in to comment.