Skip to content

Commit

Permalink
test: fix local key formatting in signing test
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabaluev committed Mar 4, 2025
1 parent 1e70567 commit 372acec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 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.

3 changes: 2 additions & 1 deletion util/signing/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async-trait = { workspace = true }
maptos-dof-execution = { workspace = true }
maptos-execution-util = { workspace = true }
movement-signing-aptos = { workspace = true }
movement-signer-loader = { workspace = true }
movement-signer-loader = { workspace = true }
movement-signer-local = { workspace = true }
movement-signer-aws-kms = { workspace = true }
movement-signing-eth = { workspace = true }
Expand All @@ -28,6 +28,7 @@ aptos-types = { workspace = true }
anyhow = { workspace = true }
chrono = { workspace = true }
ed25519-dalek = { workspace = true, features = ["rand_core"] }
hex = { workspace = true }
# Workspace is on rand 0.7 due largely to aptos-core
rand = "0.8"
sha3 = "0.10.8"
Expand Down
7 changes: 3 additions & 4 deletions util/signing/testing/tests/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use aptos_types::transaction::{
};

use anyhow::Context;
use aptos_crypto::ValidCryptoMaterialStringExt;
use movement_signer_loader::identifiers::{local::Local, SignerIdentifier};
use tempfile::TempDir;

Expand Down Expand Up @@ -45,9 +44,9 @@ async fn execute_signed_transaction() -> Result<(), anyhow::Error> {
let private_key = Ed25519PrivateKey::generate_for_testing();
let mut config = Config::default();
let signing_key = ed25519_dalek::SigningKey::from_bytes(&private_key.to_bytes());
config.chain.maptos_private_key_signer_identifier = SignerIdentifier::Local(Local {
private_key_hex_bytes: private_key.to_encoded_string()?.to_string(),
});
let private_key_hex_bytes = hex::encode(&private_key.to_bytes());
config.chain.maptos_private_key_signer_identifier =
SignerIdentifier::Local(Local { private_key_hex_bytes });
let signer = TestSigner::new(signing_key);
let (executor, _tempdir) = setup(config)?;
let transaction = create_signed_transaction(&signer).await?;
Expand Down

0 comments on commit 372acec

Please sign in to comment.