File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
testnet/stacks-node/src/tests/signer/commands Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ use super :: context:: { SignerTestContext , SignerTestState } ;
2
+ use crate :: tests:: signer:: v0:: MultipleMinerTest ;
3
+ use madhouse:: { Command , CommandWrapper } ;
4
+ use proptest:: prelude:: { Just , Strategy } ;
5
+ use std:: sync:: { Arc , Mutex } ;
6
+
7
+ pub struct SendTransferTxCommand {
8
+ miners : Arc < Mutex < MultipleMinerTest > > ,
9
+ }
10
+
11
+ impl SendTransferTxCommand {
12
+ pub fn new ( miners : Arc < Mutex < MultipleMinerTest > > ) -> Self {
13
+ Self { miners }
14
+ }
15
+ }
16
+
17
+ impl Command < SignerTestState , SignerTestContext > for SendTransferTxCommand {
18
+ fn check ( & self , _state : & SignerTestState ) -> bool {
19
+ println ! ( "Checking: Sending transfer tx. Result: {:?}" , true ) ;
20
+ true
21
+ }
22
+
23
+ fn apply ( & self , _state : & mut SignerTestState ) {
24
+ println ! ( "Applying: Sending transfer tx" ) ;
25
+
26
+ self . miners . lock ( ) . unwrap ( ) . send_transfer_tx ( ) ;
27
+ }
28
+
29
+ fn label ( & self ) -> String {
30
+ "SEND_TRANSFER_TX" . to_string ( )
31
+ }
32
+
33
+ fn build (
34
+ ctx : Arc < SignerTestContext > ,
35
+ ) -> impl Strategy < Value = CommandWrapper < SignerTestState , SignerTestContext > > {
36
+ Just ( CommandWrapper :: new ( SendTransferTxCommand :: new (
37
+ ctx. miners . clone ( ) ,
38
+ ) ) )
39
+ }
40
+ }
You can’t perform that action at this time.
0 commit comments