use miden_objects::account::auth::PublicKeyCommitment;
use miden_objects::account::{AccountComponent, StorageSlot};
use crate::account::components::ecdsa_k256_keccak_library;
pub struct AuthEcdsaK256Keccak {
pub_key: PublicKeyCommitment,
}
impl AuthEcdsaK256Keccak {
pub fn new(pub_key: PublicKeyCommitment) -> Self {
Self { pub_key }
}
}
impl From<AuthEcdsaK256Keccak> for AccountComponent {
fn from(ecdsa: AuthEcdsaK256Keccak) -> Self {
AccountComponent::new(
ecdsa_k256_keccak_library(),
vec![StorageSlot::Value(ecdsa.pub_key.into())],
)
.expect("ecdsa component should satisfy the requirements of a valid account component")
.with_supports_all_types()
}
}