MCPcopy Create free account
hub / github.com/BitVM/BitVM / test_validate_invalid_value

Function test_validate_invalid_value

bridge/tests/bridge/validate/validate.rs:115–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113
114#[tokio::test]
115async fn test_validate_invalid_value() {
116 let (mut peg_in_graph, _, _, _) = setup_and_create_graphs().await;
117
118 let deposit_tx = peg_in_graph.peg_in_deposit_transaction.tx_mut();
119 deposit_tx.output[0].value = Amount::from_sat(1);
120 let deposit_txid = deposit_tx.compute_txid();
121
122 let result = peg_in_graph.validate();
123
124 assert!(matches!(
125 result,
126 Err(Error::Validation(ValidationError::TxValidationFailed(
127 _,
128 _,
129 _
130 )))
131 ));
132
133 if let Err(Error::Validation(ValidationError::TxValidationFailed(tx_name, txid, input_index))) =
134 result
135 {
136 assert_eq!(tx_name, "PegInDeposit");
137 assert_eq!(txid, deposit_txid);
138 assert_eq!(input_index, 0);
139 }
140}
141
142#[tokio::test]
143async fn test_validate_invalid_script_pubkey() {

Callers

nothing calls this directly

Calls 3

setup_and_create_graphsFunction · 0.70
tx_mutMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected