Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support profiles #105

Merged
merged 6 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:

- name: Run Tests
env:
IPFS_URL: ${{ secrets.IPFS_URL }}
WALLET_KEY: ${{ secrets.WALLET_KEY }}
RPC_URL: ${{ secrets.RPC_URL }}
RHS_URL: ${{ secrets.RHS_URL }}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ To run them, please set following variables:
export WALLET_KEY="...key in hex format"
export RPC_URL="...url to polygon network rpc node"
export RHS_URL="..reverse hash service url"
export IPFS_URL="url for ipfs"

```

And place actual circuits to `test/proofs/testdata`
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"dependencies": {
"@iden3/js-crypto": "1.0.0",
"@iden3/js-iden3-core": "1.0.0",
"@iden3/js-jsonld-merklization": "1.0.0",
"@iden3/js-jsonld-merklization": "1.0.1",
"@iden3/js-jwz": "1.0.0",
"@iden3/js-merkletree": "1.0.0",
"@lumeweb/js-sha3-browser": "^0.8.1",
Expand Down
13 changes: 8 additions & 5 deletions src/credentials/status/on-chain-revocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,24 @@ export class OnChainResolver implements CredentialStatusResolver {
issuer: string;
} {
const url = new URL(id);
if (!url.searchParams.has('contractAddress')) {
const contractId = url.searchParams.get('contractAddress');
const revocationNonceParam = url.searchParams.get('revocationNonce');

if (!contractId) {
throw new Error('contractAddress not found');
}
if (!url.searchParams.has('revocationNonce')) {
if (!revocationNonceParam) {
throw new Error('revocationNonce not found');
}

const issuer = id.split('/')[0];
if (!issuer) {
throw new Error('issuer not found in credentialStatus id');
}

// TODO (illia-korotia): after merging core v2 need to parse contract address from did if `contractAddress` is not present in id as param
const contractId = url.searchParams.get('contractAddress');
const revocationNonce = parseInt(url.searchParams.get('revocationNonce')!, 10);
const parts = contractId!.split(':');
const revocationNonce = parseInt(revocationNonceParam, 10);
const parts = contractId.split(':');
if (parts.length != 2) {
throw new Error('invalid contract address');
}
Expand Down
Loading
Loading