@@ -15,7 +15,7 @@ use vault_sdk::VaultClient;
1515use vault_types:: enclave:: encrypted:: eoa:: MessageFormat ;
1616
1717use crate :: {
18- credentials:: { SigningCredential , KmsClientCache } ,
18+ credentials:: SigningCredential ,
1919 defs:: AddressDef ,
2020 error:: { EngineError , SerialisableAwsSdkError , SerialisableAwsSignerError } ,
2121 execution_options:: aa:: { EntrypointAndFactoryDetails , EntrypointAndFactoryDetailsDeserHelper } ,
@@ -204,16 +204,14 @@ pub trait AccountSigner {
204204pub struct EoaSigner {
205205 pub vault_client : VaultClient ,
206206 pub iaw_client : IAWClient ,
207- pub kms_client_cache : KmsClientCache ,
208207}
209208
210209impl EoaSigner {
211210 /// Create a new EOA signer
212- pub fn new ( vault_client : VaultClient , iaw_client : IAWClient , kms_client_cache : KmsClientCache ) -> Self {
211+ pub fn new ( vault_client : VaultClient , iaw_client : IAWClient ) -> Self {
213212 Self {
214213 vault_client,
215214 iaw_client,
216- kms_client_cache,
217215 }
218216 }
219217}
@@ -274,10 +272,7 @@ impl AccountSigner for EoaSigner {
274272 Ok ( iaw_result. signature )
275273 }
276274 SigningCredential :: AwsKms ( creds) => {
277- // Clone and inject the cache into the credentials
278- let mut creds_with_cache = creds. clone ( ) ;
279- creds_with_cache. kms_client_cache = Some ( self . kms_client_cache . clone ( ) ) ;
280- let signer = creds_with_cache. get_signer ( options. chain_id ) . await ?;
275+ let signer = creds. get_signer ( options. chain_id ) . await ?;
281276 let message = match format {
282277 MessageFormat :: Text => message. to_string ( ) . into_bytes ( ) ,
283278 MessageFormat :: Hex => {
@@ -357,10 +352,7 @@ impl AccountSigner for EoaSigner {
357352 }
358353
359354 SigningCredential :: AwsKms ( creds) => {
360- // Clone and inject the cache into the credentials
361- let mut creds_with_cache = creds. clone ( ) ;
362- creds_with_cache. kms_client_cache = Some ( self . kms_client_cache . clone ( ) ) ;
363- let signer = creds_with_cache. get_signer ( options. chain_id ) . await ?;
355+ let signer = creds. get_signer ( options. chain_id ) . await ?;
364356
365357 // TODO: create serialisable error for @alloy-signer::error::Error
366358 let signature = signer
@@ -428,10 +420,7 @@ impl AccountSigner for EoaSigner {
428420 Ok ( iaw_result. signature )
429421 }
430422 SigningCredential :: AwsKms ( creds) => {
431- // Clone and inject the cache into the credentials
432- let mut creds_with_cache = creds. clone ( ) ;
433- creds_with_cache. kms_client_cache = Some ( self . kms_client_cache . clone ( ) ) ;
434- let signer = creds_with_cache. get_signer ( options. chain_id ) . await ?;
423+ let signer = creds. get_signer ( options. chain_id ) . await ?;
435424 let mut transaction = transaction. clone ( ) ;
436425
437426 // TODO: create serialisable error for @alloy-signer::error::Error
@@ -511,10 +500,7 @@ impl AccountSigner for EoaSigner {
511500 Ok ( iaw_result. signed_authorization )
512501 }
513502 SigningCredential :: AwsKms ( creds) => {
514- // Clone and inject the cache into the credentials
515- let mut creds_with_cache = creds. clone ( ) ;
516- creds_with_cache. kms_client_cache = Some ( self . kms_client_cache . clone ( ) ) ;
517- let signer = creds_with_cache. get_signer ( options. chain_id ) . await ?;
503+ let signer = creds. get_signer ( options. chain_id ) . await ?;
518504 let authorization_hash = authorization. signature_hash ( ) ;
519505
520506 let signature = signer. sign_hash ( & authorization_hash) . await . map_err ( |e| {
0 commit comments