Skip to content

Commit

Permalink
Make the test issuer compatible with the new wallet.
Browse files Browse the repository at this point in the history
  • Loading branch information
abizjak committed Aug 21, 2023
1 parent 2338a6a commit b887509
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion deps/concordium-rust-sdk
4 changes: 4 additions & 0 deletions test-tools/issuer-front-end/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased changes

## 1.0.1

- Make the issuer compatible with the latest 1.1.0 wallet.

## 1.0.0

- Initial issuer front end
2 changes: 1 addition & 1 deletion test-tools/issuer-front-end/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "issuer-front-end",
"packageManager": "[email protected]",
"version": "1.0.0",
"version": "1.0.1",
"license": "Apache-2.0",
"engines": {
"node": ">=16.x"
Expand Down
25 changes: 14 additions & 11 deletions test-tools/issuer-front-end/src/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type RequestSignatureResponse = {
signature: string;
commitments: object;
};
randomness: object;
randomness: Record<string, string>;
};

type RequestIssuerKeysResponse = {
Expand All @@ -49,7 +49,7 @@ type SchemaRef = {
};

interface Attribute {
[key: string]: string | number;
[key: string]: string | bigint;
}

function TestBox({ header, children, note }: TestBoxProps) {
Expand Down Expand Up @@ -710,7 +710,7 @@ export default function Main(props: WalletConnectionProps) {
JSON.stringify('number')
) {
// eslint-disable-next-line prefer-destructuring
attributes[attributeSchema[Number(key)][0]] = Number(
attributes[attributeSchema[Number(key)][0]] = BigInt(
attributeSchema[Number(key)][2]
);
} else {
Expand All @@ -732,7 +732,8 @@ export default function Main(props: WalletConnectionProps) {
provider
.addWeb3IdCredential(
{
type: types.push(credentialType),
$schema: 'https://json-schema.org/draft/2020-12/schema',
type: [...types, credentialType],
issuer: `did:ccd:testnet:sci:${credentialRegistryContratIndex}:0/issuer`,
issuanceDate: new Date().toISOString(),
credentialSubject: { attributes },
Expand Down Expand Up @@ -1024,7 +1025,7 @@ export default function Main(props: WalletConnectionProps) {
className="inputFieldStyle"
id="credentialMetaDataURL"
type="text"
placeholder="https://raw.githubusercontent.com/Concordium/concordium-web3id/credential-metadata-example/examples/json-schemas/metadata/credential-metadata.json"
placeholder="https://gist.githubusercontent.com/abizjak/ff1e90d82c5446c0e001ee6d4e33ea6b/raw/4528363aff42e3ff36b50a1d873287f2f520d610/metadata.json"
onChange={changeCredentialMetaDataURLHandler}
/>
<br />
Expand Down Expand Up @@ -1098,7 +1099,7 @@ export default function Main(props: WalletConnectionProps) {
JSON.stringify('number')
) {
// eslint-disable-next-line prefer-destructuring
attributes[attributeSchema[Number(key)][0]] = Number(
attributes[attributeSchema[Number(key)][0]] = BigInt(
attributeSchema[Number(key)][2]
);
} else {
Expand All @@ -1120,7 +1121,8 @@ export default function Main(props: WalletConnectionProps) {
provider
.addWeb3IdCredential(
{
type: types.push(credentialType),
$schema: 'https://json-schema.org/draft/2020-12/schema',
type: [...types, credentialType],
issuer: `did:ccd:testnet:sci:${credentialRegistryContratIndex}:0/issuer`,
issuanceDate: new Date().toISOString(),
credentialSubject: { attributes },
Expand Down Expand Up @@ -1157,7 +1159,7 @@ export default function Main(props: WalletConnectionProps) {
const proofObject = {
type: 'Ed25519Signature2020',
verificationMethod: id,
proofPurpose: 'assertionMethod',
assertionMethod: 'assertionMethod',
proofValue:
requestSignatureResponse.signedCommitments.signature,
};
Expand Down Expand Up @@ -1309,7 +1311,7 @@ export default function Main(props: WalletConnectionProps) {
className="inputFieldStyle"
id="credentialMetaDataURL"
type="text"
placeholder="https://raw.githubusercontent.com/Concordium/concordium-web3id/credential-metadata-example/examples/json-schemas/metadata/credential-metadata.json"
placeholder="https://gist.githubusercontent.com/abizjak/ff1e90d82c5446c0e001ee6d4e33ea6b/raw/4528363aff42e3ff36b50a1d873287f2f520d610/metadata.json"
onChange={changeCredentialMetaDataURLHandler}
/>
<br />
Expand Down Expand Up @@ -1383,7 +1385,7 @@ export default function Main(props: WalletConnectionProps) {
JSON.stringify('number')
) {
// eslint-disable-next-line prefer-destructuring
attributes[attributeSchema[Number(key)][0]] = Number(
attributes[attributeSchema[Number(key)][0]] = BigInt(
attributeSchema[Number(key)][2]
);
} else {
Expand All @@ -1405,7 +1407,8 @@ export default function Main(props: WalletConnectionProps) {
provider
.addWeb3IdCredential(
{
type: types.push(credentialType),
$schema: 'https://json-schema.org/draft/2020-12/schema',
type: [...types, credentialType],
issuer: `did:ccd:testnet:sci:${credentialRegistryContratIndex}:0/issuer`,
issuanceDate: new Date().toISOString(),
credentialSubject: { attributes },
Expand Down

0 comments on commit b887509

Please sign in to comment.