Skip to content

Commit cbb9674

Browse files
committed
Add tests for fee getter to all vectors
1 parent 413c3c7 commit cbb9674

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/transaction.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ mod tests {
751751
assert_eq!(tx.output[1].value, confidential::Value::Explicit( 3300));
752752
assert_eq!(tx.output[0].minimum_value(), 9999996700);
753753
assert_eq!(tx.output[1].minimum_value(), 3300);
754+
assert_eq!(tx.fee(), 3300);
754755

755756
// CT transaction with explicit input (with script witness) and confidential outputs
756757
let tx: Transaction = hex_deserialize!(
@@ -969,6 +970,8 @@ mod tests {
969970
assert_eq!(tx.output[1].is_null_data(), false);
970971
assert_eq!(tx.output[2].is_null_data(), false);
971972

973+
assert_eq!(tx.fee(), 36480);
974+
972975
// Coinbase tx
973976
let tx: Transaction = hex_deserialize!(
974977
"0200000001010000000000000000000000000000000000000000000000000000\
@@ -1003,6 +1006,7 @@ mod tests {
10031006
assert_eq!(tx.output[1].is_pegout(), false);
10041007
assert_eq!(tx.output[0].pegout_data(), None);
10051008
assert_eq!(tx.output[1].pegout_data(), None);
1009+
assert_eq!(tx.fee(), 0);
10061010
}
10071011

10081012
#[test]
@@ -1126,6 +1130,7 @@ mod tests {
11261130
assert_eq!(tx.output[1].is_pegout(), false);
11271131
assert_eq!(tx.output[0].pegout_data(), None);
11281132
assert_eq!(tx.output[1].pegout_data(), None);
1133+
assert_eq!(tx.fee(), 6260);
11291134
}
11301135

11311136
#[test]
@@ -1153,6 +1158,7 @@ mod tests {
11531158
assert_eq!(tx.output.len(), 1);
11541159
assert_eq!(tx.output[0].is_null_data(), true);
11551160
assert_eq!(tx.output[0].is_pegout(), true);
1161+
assert_eq!(tx.fee(), 0);
11561162
assert_eq!(
11571163
tx.output[0].pegout_data(),
11581164
Some(super::PegoutData {
@@ -1504,6 +1510,7 @@ mod tests {
15041510
assert_eq!(tx.input.len(), 1);
15051511
assert_eq!(tx.output.len(), 3);
15061512
assert_eq!(tx.input[0].has_issuance, true);
1513+
assert_eq!(tx.fee(), 56400);
15071514
assert_eq!(
15081515
tx.input[0].asset_issuance,
15091516
AssetIssuance {
@@ -1626,6 +1633,7 @@ mod tests {
16261633

16271634
assert_eq!(tx.output[0].asset, tx.output[1].asset);
16281635
assert_eq!(tx.output[2].asset, tx.output[1].asset);
1636+
assert_eq!(tx.fee(), 1788);
16291637
}
16301638

16311639
#[test]
@@ -1667,6 +1675,7 @@ mod tests {
16671675

16681676
assert_eq!(tx.output[0].asset, tx.output[1].asset);
16691677
assert_eq!(tx.output[2].asset, tx.output[1].asset);
1678+
assert_eq!(tx.fee(), 1788);
16701679
}
16711680

16721681
#[test]
@@ -1707,6 +1716,7 @@ mod tests {
17071716

17081717
assert_eq!(tx.output[0].asset, tx.output[1].asset);
17091718
assert_eq!(tx.output[2].asset, tx.output[1].asset);
1719+
assert_eq!(tx.fee(), 1788);
17101720
}
17111721
}
17121722

0 commit comments

Comments
 (0)