tests: replace Amount::from_sat_unchecked with from_sat.unwrap
There are only 7 instances of this so just call .unwrap() on each one.
This commit is contained in:
parent
beaa2db7e5
commit
05c8b043ff
|
@ -1502,7 +1502,7 @@ mod tests {
|
||||||
)]),
|
)]),
|
||||||
}],
|
}],
|
||||||
output: vec![TxOut {
|
output: vec![TxOut {
|
||||||
value: Amount::from_sat_unchecked(190_303_501_938),
|
value: Amount::from_sat(190_303_501_938).unwrap(),
|
||||||
script_pubkey: ScriptBuf::from_hex(
|
script_pubkey: ScriptBuf::from_hex(
|
||||||
"a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587",
|
"a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587",
|
||||||
)
|
)
|
||||||
|
@ -1553,7 +1553,7 @@ mod tests {
|
||||||
Input {
|
Input {
|
||||||
non_witness_utxo: Some(tx),
|
non_witness_utxo: Some(tx),
|
||||||
witness_utxo: Some(TxOut {
|
witness_utxo: Some(TxOut {
|
||||||
value: Amount::from_sat_unchecked(190_303_501_938),
|
value: Amount::from_sat(190_303_501_938).unwrap(),
|
||||||
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587").unwrap(),
|
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587").unwrap(),
|
||||||
}),
|
}),
|
||||||
sighash_type: Some("SIGHASH_SINGLE|SIGHASH_ANYONECANPAY".parse::<PsbtSighashType>().unwrap()),
|
sighash_type: Some("SIGHASH_SINGLE|SIGHASH_ANYONECANPAY".parse::<PsbtSighashType>().unwrap()),
|
||||||
|
@ -1729,7 +1729,7 @@ mod tests {
|
||||||
script_pubkey: ScriptBuf::from_hex("76a91485cff1097fd9e008bb34af709c62197b38978a4888ac").unwrap(),
|
script_pubkey: ScriptBuf::from_hex("76a91485cff1097fd9e008bb34af709c62197b38978a4888ac").unwrap(),
|
||||||
},
|
},
|
||||||
TxOut {
|
TxOut {
|
||||||
value: Amount::from_sat_unchecked(190_303_501_938),
|
value: Amount::from_sat(190_303_501_938).unwrap(),
|
||||||
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587").unwrap(),
|
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587").unwrap(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -2062,7 +2062,7 @@ mod tests {
|
||||||
script_pubkey: ScriptBuf::from_hex("76a91485cff1097fd9e008bb34af709c62197b38978a4888ac").unwrap(),
|
script_pubkey: ScriptBuf::from_hex("76a91485cff1097fd9e008bb34af709c62197b38978a4888ac").unwrap(),
|
||||||
},
|
},
|
||||||
TxOut {
|
TxOut {
|
||||||
value: Amount::from_sat_unchecked(190_303_501_938),
|
value: Amount::from_sat(190_303_501_938).unwrap(),
|
||||||
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587").unwrap(),
|
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587").unwrap(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -2234,7 +2234,7 @@ mod tests {
|
||||||
script_pubkey: ScriptBuf::new()
|
script_pubkey: ScriptBuf::new()
|
||||||
},
|
},
|
||||||
TxOut {
|
TxOut {
|
||||||
value: Amount::from_sat_unchecked(190_303_501_938),
|
value: Amount::from_sat(190_303_501_938).unwrap(),
|
||||||
script_pubkey: ScriptBuf::new()
|
script_pubkey: ScriptBuf::new()
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -235,7 +235,7 @@ fn serde_regression_psbt() {
|
||||||
.unwrap()]),
|
.unwrap()]),
|
||||||
}],
|
}],
|
||||||
output: vec![TxOut {
|
output: vec![TxOut {
|
||||||
value: Amount::from_sat_unchecked(190_303_501_938),
|
value: Amount::from_sat(190_303_501_938).unwrap(),
|
||||||
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587")
|
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587")
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
}],
|
}],
|
||||||
|
@ -282,7 +282,7 @@ fn serde_regression_psbt() {
|
||||||
inputs: vec![Input {
|
inputs: vec![Input {
|
||||||
non_witness_utxo: Some(tx),
|
non_witness_utxo: Some(tx),
|
||||||
witness_utxo: Some(TxOut {
|
witness_utxo: Some(TxOut {
|
||||||
value: Amount::from_sat_unchecked(190_303_501_938),
|
value: Amount::from_sat(190_303_501_938).unwrap(),
|
||||||
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587").unwrap(),
|
script_pubkey: ScriptBuf::from_hex("a914339725ba21efd62ac753a9bcd067d6c7a6a39d0587").unwrap(),
|
||||||
}),
|
}),
|
||||||
sighash_type: Some(PsbtSighashType::from("SIGHASH_SINGLE|SIGHASH_ANYONECANPAY".parse::<EcdsaSighashType>().unwrap())),
|
sighash_type: Some(PsbtSighashType::from("SIGHASH_SINGLE|SIGHASH_ANYONECANPAY".parse::<EcdsaSighashType>().unwrap())),
|
||||||
|
|
Loading…
Reference in New Issue