Manually format a bunch of vecs
In preparation for modifying some unit test data structures, manually format the code so it is uniform. Move elements added to a vec with `vec!` onto a new line so they all line up and one can better see what fields go where. Refactor only, no logic changes.
This commit is contained in:
parent
83e1c40c4d
commit
3e70c01826
|
@ -908,7 +908,8 @@ mod tests {
|
|||
unsigned_tx: Transaction {
|
||||
version: 2,
|
||||
lock_time: absolute::LockTime::from_consensus(1257139),
|
||||
input: vec![TxIn {
|
||||
input: vec![
|
||||
TxIn {
|
||||
previous_output: OutPoint {
|
||||
txid: Txid::from_hex(
|
||||
"f61b1742ca13176464adb3cb66050c00787bb3a4eead37e985f2df1e37718126",
|
||||
|
@ -918,7 +919,8 @@ mod tests {
|
|||
script_sig: ScriptBuf::new(),
|
||||
sequence: Sequence::ENABLE_LOCKTIME_NO_RBF,
|
||||
witness: Witness::default(),
|
||||
}],
|
||||
}
|
||||
],
|
||||
output: vec![
|
||||
TxOut {
|
||||
value: 99999699,
|
||||
|
@ -980,7 +982,8 @@ mod tests {
|
|||
let tx = Transaction {
|
||||
version: 1,
|
||||
lock_time: absolute::LockTime::ZERO,
|
||||
input: vec![TxIn {
|
||||
input: vec![
|
||||
TxIn {
|
||||
previous_output: OutPoint {
|
||||
txid: Txid::from_hex("e567952fb6cc33857f392efa3a46c995a28f69cca4bb1b37e0204dab1ec7a389").unwrap(),
|
||||
vout: 1,
|
||||
|
@ -988,7 +991,8 @@ mod tests {
|
|||
script_sig: hex_script!("160014be18d152a9b012039daf3da7de4f53349eecb985"),
|
||||
sequence: Sequence::MAX,
|
||||
witness: Witness::from_slice(&[hex!("03d2e15674941bad4a996372cb87e1856d3652606d98562fe39c5e9e7e413f2105")]),
|
||||
}],
|
||||
}
|
||||
],
|
||||
output: vec![
|
||||
TxOut {
|
||||
value: 190303501938,
|
||||
|
@ -1032,7 +1036,8 @@ mod tests {
|
|||
proprietary: proprietary.clone(),
|
||||
unknown: unknown.clone(),
|
||||
|
||||
inputs: vec![Input {
|
||||
inputs: vec![
|
||||
Input {
|
||||
non_witness_utxo: Some(tx),
|
||||
witness_utxo: Some(TxOut {
|
||||
value: 190303501938,
|
||||
|
@ -1054,13 +1059,16 @@ mod tests {
|
|||
proprietary: proprietary.clone(),
|
||||
unknown: unknown.clone(),
|
||||
..Default::default()
|
||||
}],
|
||||
outputs: vec![Output {
|
||||
}
|
||||
],
|
||||
outputs: vec![
|
||||
Output {
|
||||
bip32_derivation: keypaths,
|
||||
proprietary,
|
||||
unknown,
|
||||
..Default::default()
|
||||
}],
|
||||
}
|
||||
],
|
||||
};
|
||||
let encoded = serde_json::to_string(&psbt).unwrap();
|
||||
let decoded: PartiallySignedTransaction = serde_json::from_str(&encoded).unwrap();
|
||||
|
@ -1166,7 +1174,8 @@ mod tests {
|
|||
unsigned_tx: Transaction {
|
||||
version: 2,
|
||||
lock_time: absolute::LockTime::from_consensus(1257139),
|
||||
input: vec![TxIn {
|
||||
input: vec![
|
||||
TxIn {
|
||||
previous_output: OutPoint {
|
||||
txid: Txid::from_hex(
|
||||
"f61b1742ca13176464adb3cb66050c00787bb3a4eead37e985f2df1e37718126",
|
||||
|
@ -1176,7 +1185,8 @@ mod tests {
|
|||
script_sig: ScriptBuf::new(),
|
||||
sequence: Sequence::ENABLE_LOCKTIME_NO_RBF,
|
||||
witness: Witness::default(),
|
||||
}],
|
||||
}
|
||||
],
|
||||
output: vec![
|
||||
TxOut {
|
||||
value: 99999699,
|
||||
|
@ -1193,11 +1203,13 @@ mod tests {
|
|||
proprietary: BTreeMap::new(),
|
||||
unknown: BTreeMap::new(),
|
||||
|
||||
inputs: vec![Input {
|
||||
inputs: vec![
|
||||
Input {
|
||||
non_witness_utxo: Some(Transaction {
|
||||
version: 1,
|
||||
lock_time: absolute::LockTime::ZERO,
|
||||
input: vec![TxIn {
|
||||
input: vec![
|
||||
TxIn {
|
||||
previous_output: OutPoint {
|
||||
txid: Txid::from_hex(
|
||||
"e567952fb6cc33857f392efa3a46c995a28f69cca4bb1b37e0204dab1ec7a389",
|
||||
|
@ -1224,7 +1236,8 @@ mod tests {
|
|||
hex!("3045022100d12b852d85dcd961d2f5f4ab660654df6eedcc794c0c33ce5cc309ffb5fce58d022067338a8e0e1725c197fb1a88af59f51e44e4255b20167c8684031c05d1f2592a01"),
|
||||
hex!("0223b72beef0965d10be0778efecd61fcac6f79a4ea169393380734464f84f2ab3"),
|
||||
]),
|
||||
}],
|
||||
}
|
||||
],
|
||||
output: vec![
|
||||
TxOut {
|
||||
value: 200000000,
|
||||
|
@ -1237,7 +1250,8 @@ mod tests {
|
|||
],
|
||||
}),
|
||||
..Default::default()
|
||||
},],
|
||||
},
|
||||
],
|
||||
outputs: vec![
|
||||
Output {
|
||||
..Default::default()
|
||||
|
@ -1486,7 +1500,8 @@ mod tests {
|
|||
unsigned_tx: Transaction {
|
||||
version: 2,
|
||||
lock_time: absolute::LockTime::from_consensus(1257139),
|
||||
input: vec![TxIn {
|
||||
input: vec![
|
||||
TxIn {
|
||||
previous_output: OutPoint {
|
||||
txid: Txid::from_hex(
|
||||
"f61b1742ca13176464adb3cb66050c00787bb3a4eead37e985f2df1e37718126",
|
||||
|
@ -1496,7 +1511,8 @@ mod tests {
|
|||
script_sig: ScriptBuf::new(),
|
||||
sequence: Sequence::ENABLE_LOCKTIME_NO_RBF,
|
||||
witness: Witness::default(),
|
||||
}],
|
||||
}
|
||||
],
|
||||
output: vec![
|
||||
TxOut {
|
||||
value: 99999699,
|
||||
|
@ -1513,11 +1529,13 @@ mod tests {
|
|||
proprietary: Default::default(),
|
||||
unknown: BTreeMap::new(),
|
||||
|
||||
inputs: vec![Input {
|
||||
inputs: vec![
|
||||
Input {
|
||||
non_witness_utxo: Some(Transaction {
|
||||
version: 1,
|
||||
lock_time: absolute::LockTime::ZERO,
|
||||
input: vec![TxIn {
|
||||
input: vec![
|
||||
TxIn {
|
||||
previous_output: OutPoint {
|
||||
txid: Txid::from_hex(
|
||||
"e567952fb6cc33857f392efa3a46c995a28f69cca4bb1b37e0204dab1ec7a389",
|
||||
|
@ -1544,7 +1562,8 @@ mod tests {
|
|||
hex!("3045022100d12b852d85dcd961d2f5f4ab660654df6eedcc794c0c33ce5cc309ffb5fce58d022067338a8e0e1725c197fb1a88af59f51e44e4255b20167c8684031c05d1f2592a01"),
|
||||
hex!("0223b72beef0965d10be0778efecd61fcac6f79a4ea169393380734464f84f2ab3"),
|
||||
]),
|
||||
}],
|
||||
}
|
||||
],
|
||||
output: vec![
|
||||
TxOut {
|
||||
value: 200000000,
|
||||
|
@ -1557,7 +1576,8 @@ mod tests {
|
|||
],
|
||||
}),
|
||||
..Default::default()
|
||||
},],
|
||||
},
|
||||
],
|
||||
outputs: vec![
|
||||
Output {
|
||||
..Default::default()
|
||||
|
@ -1656,7 +1676,8 @@ mod tests {
|
|||
unsigned_tx: Transaction {
|
||||
version: 2,
|
||||
lock_time: absolute::LockTime::from_consensus(1257139),
|
||||
input: vec![TxIn {
|
||||
input: vec![
|
||||
TxIn {
|
||||
previous_output: OutPoint {
|
||||
txid: Txid::from_hex(
|
||||
"f61b1742ca13176464adb3cb66050c00787bb3a4eead37e985f2df1e37718126",
|
||||
|
@ -1665,7 +1686,8 @@ mod tests {
|
|||
},
|
||||
sequence: Sequence::ENABLE_LOCKTIME_NO_RBF,
|
||||
..Default::default()
|
||||
}],
|
||||
}
|
||||
],
|
||||
output: vec![
|
||||
TxOut {
|
||||
value: output_0_val,
|
||||
|
@ -1682,11 +1704,13 @@ mod tests {
|
|||
proprietary: BTreeMap::new(),
|
||||
unknown: BTreeMap::new(),
|
||||
|
||||
inputs: vec![Input {
|
||||
inputs: vec![
|
||||
Input {
|
||||
non_witness_utxo: Some(Transaction {
|
||||
version: 1,
|
||||
lock_time: absolute::LockTime::ZERO,
|
||||
input: vec![TxIn {
|
||||
input: vec![
|
||||
TxIn {
|
||||
previous_output: OutPoint {
|
||||
txid: Txid::from_hex(
|
||||
"e567952fb6cc33857f392efa3a46c995a28f69cca4bb1b37e0204dab1ec7a389",
|
||||
|
@ -1705,7 +1729,8 @@ mod tests {
|
|||
},
|
||||
sequence: Sequence::MAX,
|
||||
..Default::default()
|
||||
}],
|
||||
}
|
||||
],
|
||||
output: vec![
|
||||
TxOut {
|
||||
value: prev_output_val,
|
||||
|
@ -1718,7 +1743,8 @@ mod tests {
|
|||
],
|
||||
}),
|
||||
..Default::default()
|
||||
},],
|
||||
},
|
||||
],
|
||||
outputs: vec![
|
||||
Output {
|
||||
..Default::default()
|
||||
|
|
Loading…
Reference in New Issue