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

Function test_validate_invalid_script_sig

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

Source from the content-addressed store, hash-verified

57
58#[tokio::test]
59async fn test_validate_invalid_script_sig() {
60 let (mut peg_in_graph, _, _, _) = setup_and_create_graphs().await;
61
62 let deposit_tx = peg_in_graph.peg_in_deposit_transaction.tx_mut();
63 deposit_tx.input[0].script_sig = generate_burn_script();
64 let deposit_txid = deposit_tx.compute_txid();
65
66 let result = peg_in_graph.validate();
67
68 assert!(matches!(
69 result,
70 Err(Error::Validation(ValidationError::TxValidationFailed(
71 _,
72 _,
73 _
74 )))
75 ));
76
77 if let Err(Error::Validation(ValidationError::TxValidationFailed(tx_name, txid, input_index))) =
78 result
79 {
80 assert_eq!(tx_name, "PegInDeposit");
81 assert_eq!(txid, deposit_txid);
82 assert_eq!(input_index, 0);
83 }
84}
85
86#[tokio::test]
87async fn test_validate_invalid_sequence() {

Callers

nothing calls this directly

Calls 4

generate_burn_scriptFunction · 0.85
setup_and_create_graphsFunction · 0.70
tx_mutMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected