Skip to content

Commit

Permalink
Update naming and bump rust-bindings a major
Browse files Browse the repository at this point in the history
  • Loading branch information
orhoj committed Dec 19, 2023
1 parent 3ea3578 commit 6b1e4c0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
16 changes: 12 additions & 4 deletions packages/rust-bindings/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Changelog

## 2.1.0
## 3.0.0

## Breaking changes

- The function `create_id_request_v1_ext` exposed with the WASM entrypoint `createIdRequestV1` now expects a new JSON type.
- The function `create_identity_recovery_request_ext` exposed with the WASM entrypoint `createIdentityRecoveryRequest` now expects a new JSON type.
- The function `create_unsigned_credential_v1_ext` previously exposed with the WASM entrypoint `createUnsignedCredentialV1` now expects a new JSON type and is instead exposed with the WASM entrypoint `createUnsignedCredentialWithKeysV1`.
- The WASM entrypoint `createUnsignedCredentialV1` is now instead used to create an unsigned credential from a provided seed to align it with the naming convention used for identity requests and identity recovery requests.

### Added

- WASM entrypoint (`createIdRequestWithKeysV1`) for creating an identity request by supplying the secret key material instead of the seed.
- WASM entrypoint Method (`createIdentityRecoveryRequestWithKeys`) for creating an identity recovery request by supplying the secret key material instead of the seed.
- WASM entrypoint (`createUnsignedCredentialWithSeedV1`) for creating an unsigned credential by supplying a seed instead of the secret key material.
- WASM entrypoint `createIdRequestWithKeysV1` for creating an identity request by supplying the secret key material instead of the seed.
- WASM entrypoint Method `createIdentityRecoveryRequestWithKeys` for creating an identity recovery request by supplying the secret key material instead of the seed.
- WASM entrypoint `createUnsignedCredentialV1` for creating an unsigned credential by supplying a seed instead of the secret key material.
- Note that this re-uses the WASM entrypoint previously used when supplying the secret key material directly.

### Changed

Expand Down
2 changes: 1 addition & 1 deletion packages/rust-bindings/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@concordium/rust-bindings",
"version": "2.1.0",
"version": "3.0.0",
"license": "Apache-2.0",
"engines": {
"node": ">=16"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ pub fn create_credential_v1_ext(raw_input: JsonString) -> JsResult {
create_credential_v1_aux(input).map_err(to_js_error)
}

#[wasm_bindgen(js_name = createUnsignedCredentialV1)]
#[wasm_bindgen(js_name = createUnsignedCredentialWithKeysV1)]
pub fn create_unsigned_credential_v1_ext(input: JsonString) -> JsResult {
create_unsigned_credential_with_keys_v1_aux(serde_json::from_str(&input).unwrap())
.map_err(to_js_error)
}

#[wasm_bindgen(js_name = createUnsignedCredentialWithSeedV1)]
#[wasm_bindgen(js_name = createUnsignedCredentialV1)]
pub fn create_unsigned_credential_with_seed_v1_ext(input: JsonString) -> JsResult {
create_unsigned_credential_with_seed_v1_aux(serde_json::from_str(&input).unwrap())
.map_err(to_js_error)
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"clean": "rimraf -- lib src/grpc-api"
},
"dependencies": {
"@concordium/rust-bindings": "2.1.0",
"@concordium/rust-bindings": "3.0.0",
"@grpc/grpc-js": "^1.9.4",
"@noble/ed25519": "^2.0.0",
"@noble/hashes": "^1.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/wasm/credentialDeploymentTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export function createCredentialTransaction(
identityIndex,
};

const rawRequest = wasm.createUnsignedCredentialWithSeedV1(
const rawRequest = wasm.createUnsignedCredentialV1(
JSON.stringify(internalInput)
);
let info: UnsignedCdiWithRandomness;
Expand Down Expand Up @@ -255,7 +255,7 @@ export function createCredentialTransactionNoSeed(
blindingRandomness: sigRetrievelRandomness,
};

const rawRequest = wasm.createUnsignedCredentialV1(
const rawRequest = wasm.createUnsignedCredentialWithKeysV1(
JSON.stringify(internalInput)
);
let info: UnsignedCdiWithRandomness;
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,7 @@ __metadata:
languageName: unknown
linkType: soft

"@concordium/rust-bindings@2.0.1, @concordium/rust-bindings@workspace:packages/rust-bindings":
"@concordium/rust-bindings@3.0.0, @concordium/rust-bindings@workspace:packages/rust-bindings":
version: 0.0.0-use.local
resolution: "@concordium/rust-bindings@workspace:packages/rust-bindings"
dependencies:
Expand All @@ -2219,7 +2219,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@concordium/web-sdk@workspace:packages/sdk"
dependencies:
"@concordium/rust-bindings": 2.0.1
"@concordium/rust-bindings": 3.0.0
"@grpc/grpc-js": ^1.9.4
"@noble/ed25519": ^2.0.0
"@noble/hashes": ^1.3.2
Expand Down

0 comments on commit 6b1e4c0

Please sign in to comment.