Skip to content

Commit 638fce6

Browse files
committed
Update dependencies and enhance signing capabilities
- Updated `Cargo.lock` and `Cargo.toml` to reflect the new version `1.0.23` for the `alloy` package and added `serde_repr` as a dependency. - Introduced `PrivateKeySigner` for local signing in the `SigningCredential` enum, allowing for random private key generation for testing. - Enhanced the `AccountSigner` trait to support signing operations with the new `PrivateKey` variant. - Added 7702 tests for session keys as well as owner execution These changes improve the signing capabilities and facilitate testing with local private keys.
1 parent 799a1a8 commit 638fce6

File tree

12 files changed

+1187
-100
lines changed

12 files changed

+1187
-100
lines changed

Cargo.lock

Lines changed: 84 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ members = [
1212
resolver = "2"
1313

1414
[workspace.dependencies]
15-
alloy = { version = "1.0.8" }
15+
alloy = { version = "1.0.23" }
1616
vault-types = { version = "0.1.0", git = "ssh://git@github.com/thirdweb-dev/vault.git", branch = "pb/update-alloy" }
1717
vault-sdk = { version = "0.1.0", git = "ssh://git@github.com/thirdweb-dev/vault.git", branch = "pb/update-alloy" }

core/src/credentials.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use alloy::primitives::ChainId;
2+
use alloy::signers::local::PrivateKeySigner;
23
use alloy_signer_aws::AwsSigner;
34
use aws_config::{BehaviorVersion, Region};
45
use aws_credential_types::provider::future::ProvideCredentials as ProvideCredentialsFuture;
@@ -10,6 +11,13 @@ use vault_types::enclave::auth::Auth as VaultAuth;
1011

1112
use crate::error::EngineError;
1213

14+
impl SigningCredential {
15+
/// Create a random private key credential for testing
16+
pub fn random_local() -> Self {
17+
SigningCredential::PrivateKey(PrivateKeySigner::random())
18+
}
19+
}
20+
1321
#[derive(Debug, Clone, Serialize, Deserialize)]
1422
pub enum SigningCredential {
1523
Vault(VaultAuth),
@@ -18,6 +26,10 @@ pub enum SigningCredential {
1826
thirdweb_auth: ThirdwebAuth,
1927
},
2028
AwsKms(AwsKmsCredential),
29+
/// Private key signer for testing and development
30+
/// Note: This should only be used in test environments
31+
#[serde(skip)]
32+
PrivateKey(PrivateKeySigner),
2133
}
2234

2335
#[derive(Debug, Clone, Serialize, Deserialize)]

0 commit comments

Comments
 (0)