File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -456,6 +456,13 @@ func MinFeeTx(
456
456
return 0 , errors .New ("pparams are not expected type" )
457
457
}
458
458
txBytes := tx .Cbor ()
459
+ if len (txBytes ) == 0 {
460
+ var err error
461
+ txBytes , err = cbor .Encode (tx )
462
+ if err != nil {
463
+ return 0 , err
464
+ }
465
+ }
459
466
minFee := uint64 (
460
467
(tmpPparams .MinFeeA * uint (len (txBytes ))) + tmpPparams .MinFeeB ,
461
468
)
Original file line number Diff line number Diff line change @@ -457,6 +457,13 @@ func MinFeeTx(
457
457
return 0 , errors .New ("pparams are not expected type" )
458
458
}
459
459
txBytes := tx .Cbor ()
460
+ if len (txBytes ) == 0 {
461
+ var err error
462
+ txBytes , err = cbor .Encode (tx )
463
+ if err != nil {
464
+ return 0 , err
465
+ }
466
+ }
460
467
minFee := uint64 (
461
468
(tmpPparams .MinFeeA * uint (len (txBytes ))) + tmpPparams .MinFeeB ,
462
469
)
Original file line number Diff line number Diff line change @@ -283,9 +283,13 @@ func UtxoValidateMaxTxSizeUtxo(
283
283
if ! ok {
284
284
return errors .New ("pparams are not expected type" )
285
285
}
286
- txBytes , err := cbor .Encode (tx )
287
- if err != nil {
288
- return err
286
+ txBytes := tx .Cbor ()
287
+ if len (txBytes ) == 0 {
288
+ var err error
289
+ txBytes , err = cbor .Encode (tx )
290
+ if err != nil {
291
+ return err
292
+ }
289
293
}
290
294
if uint (len (txBytes )) <= tmpPparams .MaxTxSize {
291
295
return nil
@@ -306,6 +310,13 @@ func MinFeeTx(
306
310
return 0 , errors .New ("pparams are not expected type" )
307
311
}
308
312
txBytes := tx .Cbor ()
313
+ if len (txBytes ) == 0 {
314
+ var err error
315
+ txBytes , err = cbor .Encode (tx )
316
+ if err != nil {
317
+ return 0 , err
318
+ }
319
+ }
309
320
minFee := uint64 (
310
321
(tmpPparams .MinFeeA * uint (len (txBytes ))) + tmpPparams .MinFeeB ,
311
322
)
You can’t perform that action at this time.
0 commit comments