()
| 141 | |
| 142 | #[tokio::test] |
| 143 | async fn test_validate_invalid_script_pubkey() { |
| 144 | let (mut peg_in_graph, _, _, _) = setup_and_create_graphs().await; |
| 145 | |
| 146 | let deposit_tx = peg_in_graph.peg_in_deposit_transaction.tx_mut(); |
| 147 | deposit_tx.output[0].script_pubkey = generate_burn_script(); |
| 148 | let deposit_txid = deposit_tx.compute_txid(); |
| 149 | |
| 150 | let result = peg_in_graph.validate(); |
| 151 | |
| 152 | assert!(matches!( |
| 153 | result, |
| 154 | Err(Error::Validation(ValidationError::TxValidationFailed( |
| 155 | _, |
| 156 | _, |
| 157 | _ |
| 158 | ))) |
| 159 | )); |
| 160 | |
| 161 | if let Err(Error::Validation(ValidationError::TxValidationFailed(tx_name, txid, input_index))) = |
| 162 | result |
| 163 | { |
| 164 | assert_eq!(tx_name, "PegInDeposit"); |
| 165 | assert_eq!(txid, deposit_txid); |
| 166 | assert_eq!(input_index, 0); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | async fn setup_and_create_graphs() -> (PegInGraph, PegOutGraph, OutPoint, AsyncClient) { |
| 171 | let config = setup_test().await; |
nothing calls this directly
no test coverage detected