Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
fix renaming of algortihm
Browse files Browse the repository at this point in the history
Signed-off-by: Dominic Woerner <dominic.woerner@dfinity.org>
  • Loading branch information
domwoe committed Apr 8, 2024
1 parent 3cc832b commit 756c2cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resolver = "2"

[lib]
name = "schnorr_canister"
# crate-type = ["lib", "cdylib"]
crate-type = ["lib", "cdylib"]

[dependencies]
bip32 = { version = "0.5.1", features = ["k256"] }
Expand Down
17 changes: 7 additions & 10 deletions schnorr_canister.did
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
type HttpRequest = record {
url : text;
method : text;
body : vec nat8;
body : blob;
headers : vec record { text; text };
certificate_version : opt nat16;
};
type HttpResponse = record {
body : vec nat8;
body : blob;
headers : vec record { text; text };
status_code : nat16;
};
Expand All @@ -15,18 +15,15 @@ type SchnorrKeyId = record { algorithm : SchnorrAlgorithm; name : text };
type SchnorrPublicKeyArgs = record {
key_id : SchnorrKeyId;
canister_id : opt principal;
derivation_path : vec vec nat8;
};
type SchnorrPublicKeyResult = record {
public_key : vec nat8;
chain_code : vec nat8;
derivation_path : vec blob;
};
type SchnorrPublicKeyResult = record { public_key : blob; chain_code : blob };
type SignWithSchnorrArgs = record {
key_id : SchnorrKeyId;
derivation_path : vec vec nat8;
message : vec nat8;
derivation_path : vec blob;
message : blob;
};
type SignWithSchnorrResult = record { signature : vec nat8 };
type SignWithSchnorrResult = record { signature : blob };
service : () -> {
http_request : (HttpRequest) -> (HttpResponse) query;
schnorr_public_key : (SchnorrPublicKeyArgs) -> (SchnorrPublicKeyResult);
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ pub struct SignWithSchnorrResult {

#[derive(CandidType, Deserialize, Serialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub enum SchnorrAlgorithm {
#[serde(rename = "bip340secp256k1")]
Bip340Secp256k1,
#[serde(rename = "ed25519")]
Ed25519,
}

#[derive(CandidType, Deserialize, Serialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
#[serde(rename_all = "lowercase")]
pub struct SchnorrKeyId {
algorithm: SchnorrAlgorithm,
name: String,
Expand Down

0 comments on commit 756c2cd

Please sign in to comment.