@@ -57,19 +57,18 @@ impl MonzaExecutor for MonzaExecutorV1 {
57
57
}
58
58
59
59
/// Sets the transaction channel.
60
- async fn set_tx_channel (
60
+ fn set_tx_channel (
61
61
& mut self ,
62
62
tx_channel : Sender < SignedTransaction > ,
63
- ) -> Result < ( ) , anyhow :: Error > {
63
+ ) {
64
64
self . transaction_channel = tx_channel;
65
- Ok ( ( ) )
66
65
}
67
66
68
67
/// Gets the API.
69
- async fn get_api ( & self , _mode : & FinalityMode ) -> Result < Apis , anyhow :: Error > {
70
- match _mode {
68
+ fn get_api ( & self , mode : FinalityMode ) -> Apis {
69
+ match mode {
71
70
FinalityMode :: Dyn => unimplemented ! ( ) ,
72
- FinalityMode :: Opt => Ok ( self . executor . try_get_apis ( ) . await ? ) ,
71
+ FinalityMode :: Opt => self . executor . get_apis ( ) ,
73
72
FinalityMode :: Fin => unimplemented ! ( ) ,
74
73
}
75
74
}
@@ -166,7 +165,7 @@ mod tests {
166
165
let bcs_user_transaction = bcs:: to_bytes ( & user_transaction) ?;
167
166
168
167
let request = SubmitTransactionPost :: Bcs ( aptos_api:: bcs_payload:: Bcs ( bcs_user_transaction) ) ;
169
- let api = executor. get_api ( & FinalityMode :: Opt ) . await ? ;
168
+ let api = executor. get_api ( FinalityMode :: Opt ) ;
170
169
api. transactions . submit_transaction ( AcceptType :: Bcs , request) . await ?;
171
170
172
171
services_handle. abort ( ) ;
@@ -200,7 +199,7 @@ mod tests {
200
199
let bcs_user_transaction = bcs:: to_bytes ( & user_transaction) ?;
201
200
202
201
let request = SubmitTransactionPost :: Bcs ( aptos_api:: bcs_payload:: Bcs ( bcs_user_transaction) ) ;
203
- let api = executor. get_api ( & FinalityMode :: Opt ) . await ? ;
202
+ let api = executor. get_api ( FinalityMode :: Opt ) ;
204
203
api. transactions . submit_transaction ( AcceptType :: Bcs , request) . await ?;
205
204
206
205
let received_transaction = rx. recv ( ) . await ?;
@@ -261,7 +260,7 @@ mod tests {
261
260
262
261
let request =
263
262
SubmitTransactionPost :: Bcs ( aptos_api:: bcs_payload:: Bcs ( bcs_user_transaction) ) ;
264
- let api = executor. get_api ( & FinalityMode :: Opt ) . await ? ;
263
+ let api = executor. get_api ( FinalityMode :: Opt ) ;
265
264
api. transactions . submit_transaction ( AcceptType :: Bcs , request) . await ?;
266
265
267
266
let received_transaction = rx. recv ( ) . await ?;
@@ -369,7 +368,7 @@ mod tests {
369
368
executor. execute_block ( block) . await ?;
370
369
371
370
// Retrieve the executor's API interface and fetch the transaction by each hash.
372
- let apis = executor. try_get_apis ( ) . await ? ;
371
+ let apis = executor. get_apis ( ) ;
373
372
for hash in transaction_hashes {
374
373
let _ = apis
375
374
. transactions
0 commit comments