@@ -195,25 +195,25 @@ func (b *TransactionBodyBase) Donation() uint64 {
195195 return 0
196196}
197197
198- func (b * TransactionBodyBase ) Utxorpc () * utxorpc.Tx {
199- return nil
198+ func (b * TransactionBodyBase ) Utxorpc () ( * utxorpc.Tx , error ) {
199+ return nil , nil
200200}
201201
202202// TransactionBodyToUtxorpc is a common helper for converting TransactionBody to utxorpc.Tx
203- func TransactionBodyToUtxorpc (tx TransactionBody ) * utxorpc.Tx {
203+ func TransactionBodyToUtxorpc (tx TransactionBody ) ( * utxorpc.Tx , error ) {
204204 txi := []* utxorpc.TxInput {}
205205 txo := []* utxorpc.TxOutput {}
206206 for _ , i := range tx .Inputs () {
207207 input , err := i .Utxorpc ()
208208 if err != nil {
209- return nil
209+ return nil , err
210210 }
211211 txi = append (txi , input )
212212 }
213213 for _ , o := range tx .Outputs () {
214214 output , err := o .Utxorpc ()
215215 if err != nil {
216- return nil
216+ return nil , err
217217 }
218218 txo = append (txo , output )
219219 }
@@ -236,17 +236,17 @@ func TransactionBodyToUtxorpc(tx TransactionBody) *utxorpc.Tx {
236236 for _ , ri := range tx .ReferenceInputs () {
237237 input , err := ri .Utxorpc ()
238238 if err != nil {
239- return nil
239+ return nil , err
240240 }
241241 ret .ReferenceInputs = append (ret .ReferenceInputs , input )
242242 }
243243 for _ , c := range tx .Certificates () {
244244 cert , err := c .Utxorpc ()
245245 if err != nil {
246- return nil
246+ return nil , err
247247 }
248248 ret .Certificates = append (ret .Certificates , cert )
249249 }
250250
251- return ret
251+ return ret , nil
252252}
0 commit comments