Skip to content

Commit

Permalink
Merge pull request #207 from celo-org/alecps/fixBackwardsCompTest
Browse files Browse the repository at this point in the history
fix test identifier backwards compatibility test
  • Loading branch information
alecps authored Jan 5, 2024
2 parents 025b994 + be7cec3 commit 1f41cae
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 1,480 deletions.
2 changes: 2 additions & 0 deletions .changeset/nice-laws-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/tender-frogs-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 3 additions & 2 deletions packages/identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"clean": "yarn run --top-level tsc --build . --clean",
"docs": "typedoc",
"test": "yarn jest --runInBand --testPathIgnorePatterns src/odis/identifier-backwards-compatibility.test.ts",
"test:backwards-compatibility": "yarn jest src/odis/identifier-backwards-compatibility.test.ts",
"lint": "yarn run --top-level eslint .",
"prepublish": "yarn build"
},
Expand Down Expand Up @@ -46,8 +47,8 @@
"fetch-mock": "9.11.0",
"ganache": "npm:@celo/[email protected]",
"jest": "^29.7.0",
"old-celo-base": "npm:@celo/base@5.0.0",
"old-identity-sdk": "npm:@celo/identity@1.5.2"
"old-celo-base": "npm:@celo/base@1.5.2",
"old-celo-identity": "npm:@celo/identity@5.1.0"
},
"engines": {
"node": ">=16"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getPhoneHash } from 'old-celo-base'
import { soliditySha3 } from '@celo/utils/lib/solidity'
import { OdisUtils as OdisUtilsOld } from 'old-identity-sdk'
import { getPhoneHash } from 'old-celo-base'
import { OdisUtils as OdisUtilsOld } from 'old-celo-identity'
import { OdisUtils } from '../../lib'
import fetchMock from '../__mocks__/cross-fetch'
import { WasmBlsBlindingClient } from './bls-blinding-client'
import { AuthenticationMethod, AuthSigner, getServiceContext, OdisContextName } from './query'
import fetchMock from '../__mocks__/cross-fetch'

const { getBlindedIdentifier, getIdentifierHash, getObfuscatedIdentifier, IdentifierPrefix } =
OdisUtils.Identifier
Expand All @@ -20,8 +20,11 @@ const authSigner: AuthSigner = {
authenticationMethod: AuthenticationMethod.ENCRYPTION_KEY,
rawKey: dekPrivateKey,
}
const oldServiceContext = OdisUtilsOld.Query.getServiceContext('alfajores')
const oldServiceContext = OdisUtilsOld.Query.getServiceContext(
OdisUtilsOld.Query.OdisContextName.ALFAJORES,
)
const currentServiceContext = getServiceContext(OdisContextName.ALFAJORES)
oldServiceContext.odisUrl = currentServiceContext.odisUrl

const expectedObfuscatedIdentifier =
'0xf82c6272fd57d3e5d4e291be16b3ebac5c616084a5e6f3730c73f62efd39c6ae'
Expand Down
Loading

0 comments on commit 1f41cae

Please sign in to comment.