()
| 257 | |
| 258 | #[test] |
| 259 | fn test_complex_transaction() { |
| 260 | let script_sig = ScriptBuf::from_bytes(vec![0x76, 0xa9, 0x14]); |
| 261 | let script_pubkey = ScriptBuf::from_bytes(vec![0x76, 0xa9, 0x14]); |
| 262 | |
| 263 | let tx = Transaction { |
| 264 | version: Version(1), |
| 265 | lock_time: LockTime::from_consensus(0), |
| 266 | input: vec![TxIn { |
| 267 | previous_output: OutPoint { |
| 268 | txid: bitcoin::Txid::from_byte_array([0; 32]), |
| 269 | vout: 0, |
| 270 | }, |
| 271 | script_sig: script_sig.clone(), |
| 272 | sequence: Sequence(0xffffffff), |
| 273 | witness: Witness::new(), |
| 274 | }], |
| 275 | output: vec![TxOut { |
| 276 | value: Amount::from_sat(50000), |
| 277 | script_pubkey: script_pubkey.clone(), |
| 278 | }], |
| 279 | }; |
| 280 | |
| 281 | let bridge_tx = CircuitTransaction(tx.clone()); |
| 282 | |
| 283 | assert_eq!(bridge_tx.version, tx.version); |
| 284 | assert_eq!(bridge_tx.lock_time, tx.lock_time); |
| 285 | assert_eq!(bridge_tx.input.len(), 1); |
| 286 | assert_eq!(bridge_tx.output.len(), 1); |
| 287 | assert_eq!(bridge_tx.input[0].script_sig, script_sig); |
| 288 | assert_eq!(bridge_tx.output[0].script_pubkey, script_pubkey); |
| 289 | assert_eq!(bridge_tx.output[0].value, Amount::from_sat(50000)); |
| 290 | assert_eq!(bridge_tx.txid(), tx.compute_txid().to_byte_array()); |
| 291 | } |
| 292 | } |
nothing calls this directly
no test coverage detected