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

Function test_validate_invalid_sequence

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

Source from the content-addressed store, hash-verified

85
86#[tokio::test]
87async fn test_validate_invalid_sequence() {
88 let (mut peg_in_graph, _, _, _) = setup_and_create_graphs().await;
89
90 let deposit_tx = peg_in_graph.peg_in_deposit_transaction.tx_mut();
91 deposit_tx.input[0].sequence = bitcoin::Sequence(100);
92 let deposit_txid = deposit_tx.compute_txid();
93
94 let result = peg_in_graph.validate();
95
96 assert!(matches!(
97 result,
98 Err(Error::Validation(ValidationError::TxValidationFailed(
99 _,
100 _,
101 _
102 )))
103 ));
104
105 if let Err(Error::Validation(ValidationError::TxValidationFailed(tx_name, txid, input_index))) =
106 result
107 {
108 assert_eq!(tx_name, "PegInDeposit");
109 assert_eq!(txid, deposit_txid);
110 assert_eq!(input_index, 0);
111 }
112}
113
114#[tokio::test]
115async fn test_validate_invalid_value() {

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