Skip to content

Commit

Permalink
Add federated keyless to the rust sdk (#14905)
Browse files Browse the repository at this point in the history
* Add federated keyless support to rust sdk

* update

* update local account generator

* fix
  • Loading branch information
heliuchuan authored Oct 10, 2024
1 parent 5e55441 commit a84e2be
Show file tree
Hide file tree
Showing 7 changed files with 401 additions and 104 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ use anyhow::bail;
// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0
use aptos_crypto::ed25519::Ed25519PrivateKey;
use aptos_sdk::types::{AccountKey, EphemeralKeyPair, KeylessAccount, LocalAccount};
use aptos_sdk::types::{
AccountKey, EphemeralKeyPair, EphemeralPrivateKey, KeylessAccount, LocalAccount,
};
use aptos_transaction_generator_lib::ReliableTransactionSubmitter;
use aptos_types::keyless::{Claims, OpenIdSig, Pepper, ZeroKnowledgeSig};
use async_trait::async_trait;
Expand Down Expand Up @@ -141,7 +143,9 @@ impl LocalAccountGenerator for KeylessAccountGenerator {

// Cloning is disabled outside #[cfg(test)]
let serialized: &[u8] = &(self.ephemeral_secret_key.to_bytes());
let esk = Ed25519PrivateKey::try_from(serialized)?;
let esk = EphemeralPrivateKey::Ed25519 {
inner_private_key: Ed25519PrivateKey::try_from(serialized)?,
};

let keyless_account = KeylessAccount::new(
&self.iss,
Expand Down
1 change: 1 addition & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ed25519-dalek-bip32 = { workspace = true }
hex = { workspace = true }
move-core-types = { workspace = true }
rand_core = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tiny-bip39 = { workspace = true }

Expand Down
Loading

0 comments on commit a84e2be

Please sign in to comment.