Skip to content

Commit

Permalink
use regex for termsAndConditions hash
Browse files Browse the repository at this point in the history
  • Loading branch information
HananINouman committed Jun 2, 2024
1 parent dfebd76 commit c988731
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/verification/termsAndConditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const hashTermsAndConditions = async (): Promise<string | null> => {

const termsHasVal = termsType.defaultValue()

termsHasVal.terms_and_conditions_hash = strToUint8Array(data?.text)
termsHasVal.terms_and_conditions_hash = strToUint8Array(data?.text.replace(/[^a-zA-Z0-9]/g, ''))

return (
'0x' +
Expand Down
2 changes: 1 addition & 1 deletion test/methods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,6 @@ describe('Cluster Client without a signer', () => {

test('Finds the hash of the latest version of terms and conditions', async () => {
const termsAndConditionsHash = await hashTermsAndConditions()
expect(termsAndConditionsHash).toEqual('0x0015d01710b4d864004320a4826f6846c2db12a7f056a126fa5ae16c0b5e2b65')
expect(termsAndConditionsHash).toEqual('0xa27f806434a2a26572582a87baf908bb0c01adcb497a0e61c58867e7c3b6743e')
})
})

0 comments on commit c988731

Please sign in to comment.