You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[rustfmt::skip]// Keep public re-exports separate.
@@ -809,7 +809,7 @@ impl Transaction {
809
809
#[inline]
810
810
pubfntotal_size(&self) -> usize{
811
811
letmut size:usize = 4;// Serialized length of a u32 for the version number.
812
-
let uses_segwit = self.uses_segwit_serialization();
812
+
let uses_segwit = self.uses_segwit_serialization();
813
813
814
814
if uses_segwit {
815
815
size += 2;// 1 byte for the marker and 1 for the flag.
@@ -819,13 +819,7 @@ impl Transaction {
819
819
size += self
820
820
.input
821
821
.iter()
822
-
.map(|input| {
823
-
if uses_segwit {
824
-
input.total_size()
825
-
}else{
826
-
input.base_size()
827
-
}
828
-
})
822
+
.map(|input| if uses_segwit { input.total_size()}else{ input.base_size()})
829
823
.sum::<usize>();
830
824
831
825
size += VarInt::from(self.output.len()).size();
@@ -1780,10 +1774,7 @@ mod tests {
1780
1774
let tx_bytes = hex!("0000fd000001021921212121212121212121f8b372b0239cc1dff600000000004f4f4f4f4f4f4f4f000000000000000000000000000000333732343133380d000000000000000000000000000000ff000000000009000dff000000000000000800000000000000000d");
1781
1775
let tx:Result<Transaction,_> = deserialize(&tx_bytes);
1782
1776
assert!(tx.is_err());
1783
-
assert!(tx
1784
-
.unwrap_err()
1785
-
.to_string()
1786
-
.contains("witness flag set but no witnesses present"));
1777
+
assert!(tx.unwrap_err().to_string().contains("witness flag set but no witnesses present"));
0 commit comments