@@ -192,7 +192,7 @@ impl Staging {
192
192
payload : & P ,
193
193
fee_algorithm : & FA ,
194
194
output_policy : chain:: transaction:: OutputPolicy ,
195
- ) -> Result < chain :: transaction :: Balance , Error >
195
+ ) -> Result < Balance , Error >
196
196
where
197
197
FA : FeeAlgorithm ,
198
198
P : Payload ,
@@ -215,7 +215,7 @@ impl Staging {
215
215
& mut self ,
216
216
fee_algorithm : & FA ,
217
217
output_policy : chain:: transaction:: OutputPolicy ,
218
- ) -> Result < chain :: transaction :: Balance , Error >
218
+ ) -> Result < Balance , Error >
219
219
where
220
220
FA : FeeAlgorithm ,
221
221
{
@@ -241,7 +241,24 @@ impl Staging {
241
241
self . finalize_payload ( & c, fee_algorithm, output_policy)
242
242
}
243
243
Certificate :: OwnerStakeDelegation ( c) => {
244
- self . finalize_payload ( & c, fee_algorithm, output_policy)
244
+ let balance = self . finalize_payload ( & c, fee_algorithm, output_policy) ?;
245
+ match self . inputs ( ) {
246
+ [ input] => match input. input {
247
+ interfaces:: TransactionInputType :: Account ( _) => ( ) ,
248
+ interfaces:: TransactionInputType :: Utxo ( _, _) => {
249
+ return Err ( Error :: TxWithOwnerStakeDelegationHasUtxoInput )
250
+ }
251
+ } ,
252
+ inputs @ _ => {
253
+ return Err ( Error :: TxWithOwnerStakeDelegationMultiInputs {
254
+ inputs : inputs. len ( ) ,
255
+ } )
256
+ }
257
+ } ;
258
+ if self . outputs ( ) . is_empty ( ) == false {
259
+ return Err ( Error :: TxWithOwnerStakeDelegationHasOutputs ) ;
260
+ }
261
+ Ok ( balance)
245
262
}
246
263
} ,
247
264
}
0 commit comments