@@ -62,8 +62,14 @@ pub trait SendTransactionRpc: SendTransaction {
62
62
#[ derive( Debug , Clone , Copy , Default ) ]
63
63
pub struct ProgramRpcClientSendTransaction ;
64
64
65
+ #[ derive( Debug , Clone , PartialEq , Eq ) ]
66
+ pub enum RpcClientResponse {
67
+ Signature ( Signature ) ,
68
+ Transaction ( Transaction ) ,
69
+ }
70
+
65
71
impl SendTransaction for ProgramRpcClientSendTransaction {
66
- type Output = Signature ;
72
+ type Output = RpcClientResponse ;
67
73
}
68
74
69
75
impl SendTransactionRpc for ProgramRpcClientSendTransaction {
@@ -76,12 +82,12 @@ impl SendTransactionRpc for ProgramRpcClientSendTransaction {
76
82
client
77
83
. send_and_confirm_transaction ( transaction)
78
84
. await
85
+ . map ( RpcClientResponse :: Signature )
79
86
. map_err ( Into :: into)
80
87
} )
81
88
}
82
89
}
83
90
84
- //
85
91
pub type ProgramClientError = Box < dyn std:: error:: Error + Send + Sync > ;
86
92
pub type ProgramClientResult < T > = Result < T , ProgramClientError > ;
87
93
@@ -265,7 +271,7 @@ impl<ST> ProgramOfflineClient<ST> {
265
271
#[ async_trait]
266
272
impl < ST > ProgramClient < ST > for ProgramOfflineClient < ST >
267
273
where
268
- ST : SendTransaction < Output = Signature > + Send + Sync ,
274
+ ST : SendTransaction < Output = RpcClientResponse > + Send + Sync ,
269
275
{
270
276
async fn get_minimum_balance_for_rent_exemption (
271
277
& self ,
@@ -279,7 +285,7 @@ where
279
285
}
280
286
281
287
async fn send_transaction ( & self , transaction : & Transaction ) -> ProgramClientResult < ST :: Output > {
282
- Ok ( * transaction. signatures . first ( ) . expect ( "need a signature" ) )
288
+ Ok ( RpcClientResponse :: Transaction ( transaction. clone ( ) ) )
283
289
}
284
290
285
291
async fn get_account ( & self , _address : Pubkey ) -> ProgramClientResult < Option < Account > > {
0 commit comments