@@ -192,7 +192,7 @@ impl Staging {
192192 payload : & P ,
193193 fee_algorithm : & FA ,
194194 output_policy : chain:: transaction:: OutputPolicy ,
195- ) -> Result < chain :: transaction :: Balance , Error >
195+ ) -> Result < Balance , Error >
196196 where
197197 FA : FeeAlgorithm ,
198198 P : Payload ,
@@ -215,7 +215,7 @@ impl Staging {
215215 & mut self ,
216216 fee_algorithm : & FA ,
217217 output_policy : chain:: transaction:: OutputPolicy ,
218- ) -> Result < chain :: transaction :: Balance , Error >
218+ ) -> Result < Balance , Error >
219219 where
220220 FA : FeeAlgorithm ,
221221 {
@@ -241,7 +241,24 @@ impl Staging {
241241 self . finalize_payload ( & c, fee_algorithm, output_policy)
242242 }
243243 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)
245262 }
246263 } ,
247264 }
0 commit comments