@@ -16,7 +16,6 @@ use signet_constants::SignetSystemConstants;
1616use signet_sim:: BuiltBlock ;
1717use signet_types:: { SignRequest , SignResponse } ;
1818use signet_zenith:: BundleHelper ;
19- use std:: sync:: OnceLock ;
2019use tracing:: Instrument ;
2120
2221/// Preparation logic for transactions issued to the host chain by the
@@ -35,8 +34,8 @@ pub struct SubmitPrep<'a> {
3534 constants : SignetSystemConstants ,
3635
3736 // Memoized quincey request and response
38- sig_request : OnceLock < SignRequest > ,
39- quincey_resp : OnceLock < SignResponse > ,
37+ sig_request : std :: sync :: OnceLock < SignRequest > ,
38+ quincey_resp : tokio :: sync :: OnceCell < SignResponse > ,
4039}
4140
4241impl < ' a > SubmitPrep < ' a > {
@@ -78,12 +77,12 @@ impl<'a> SubmitPrep<'a> {
7877
7978 /// Get the quincey signature response for the block.
8079 async fn quincey_resp ( & self ) -> eyre:: Result < & SignResponse > {
81- if let Some ( resp ) = self . quincey_resp . get ( ) {
82- return Ok ( resp ) ;
83- }
84-
85- let sig = self . quincey . get_signature ( self . sig_request ( ) ) . await ? ;
86- Ok ( self . quincey_resp . get_or_init ( || sig ) )
80+ self . quincey_resp
81+ . get_or_try_init ( || async {
82+ let sig_request = self . sig_request ( ) ;
83+ self . quincey . get_signature ( sig_request ) . await
84+ } )
85+ . await
8786 }
8887
8988 /// Get the signature components from the response.
0 commit comments