@@ -12165,6 +12165,20 @@ fn repeated_rejection() {
12165
12165
signer_test. shutdown ( ) ;
12166
12166
}
12167
12167
12168
+ fn transfers_in_block ( block : & serde_json:: Value ) -> usize {
12169
+ let transactions = block[ "transactions" ] . as_array ( ) . unwrap ( ) ;
12170
+ let mut count = 0 ;
12171
+ for tx in transactions {
12172
+ let raw_tx = tx[ "raw_tx" ] . as_str ( ) . unwrap ( ) ;
12173
+ let tx_bytes = hex_bytes ( & raw_tx[ 2 ..] ) . unwrap ( ) ;
12174
+ let parsed = StacksTransaction :: consensus_deserialize ( & mut & tx_bytes[ ..] ) . unwrap ( ) ;
12175
+ if let TransactionPayload :: TokenTransfer ( ..) = & parsed. payload {
12176
+ count += 1 ;
12177
+ }
12178
+ }
12179
+ count
12180
+ }
12181
+
12168
12182
#[ test]
12169
12183
#[ ignore]
12170
12184
/// This test verifies that a miner will re-propose the same block if it times
@@ -12270,13 +12284,14 @@ fn retry_proposal() {
12270
12284
submit_tx ( & http_origin, & transfer_tx) ;
12271
12285
12272
12286
info ! ( "Disable signer 1 from ignoring proposals" ) ;
12273
- test_observer:: clear ( ) ;
12274
12287
TEST_IGNORE_ALL_BLOCK_PROPOSALS . set ( vec ! [ ] ) ;
12275
12288
12276
12289
info ! ( "Waiting for the block to be approved" ) ;
12277
12290
wait_for ( 60 , || {
12278
- let info = get_chain_info ( & signer_test. running_nodes . conf ) ;
12279
- if info. stacks_tip_height > block_height_before {
12291
+ let blocks = test_observer:: get_blocks ( ) ;
12292
+ let last_block = blocks. last ( ) . expect ( "No blocks found" ) ;
12293
+ let height = last_block[ "block_height" ] . as_u64 ( ) . unwrap ( ) ;
12294
+ if height > block_height_before {
12280
12295
return Ok ( true ) ;
12281
12296
}
12282
12297
Ok ( false )
@@ -12285,9 +12300,8 @@ fn retry_proposal() {
12285
12300
12286
12301
// Ensure that the block was the original block with just 1 transfer
12287
12302
let blocks = test_observer:: get_blocks ( ) ;
12288
- let block = blocks. first ( ) . expect ( "No blocks found" ) ;
12289
- let transactions = block[ "transactions" ] . as_array ( ) . unwrap ( ) ;
12290
- assert_eq ! ( transactions. len( ) , 1 ) ;
12303
+ let block = blocks. last ( ) . expect ( "No blocks found" ) ;
12304
+ assert_eq ! ( transfers_in_block( block) , 1 ) ;
12291
12305
12292
12306
signer_test. shutdown ( ) ;
12293
12307
}
0 commit comments