diff --git a/pox-locking/src/events.rs b/pox-locking/src/events.rs index b1547eb2e7..49d1ba90b2 100644 --- a/pox-locking/src/events.rs +++ b/pox-locking/src/events.rs @@ -467,6 +467,14 @@ fn create_event_info_data_code( end-cycle-id: (some (+ {reward_cycle} u1)), ;; Get start cycle ID start-cycle-id: start-cycle, + ;; equal to args[3] + signer-sig: {signer_sig}, + ;; equal to args[4] + signer-key: {signer_key}, + ;; equal to args[5] + max-amount: {max_amount}, + ;; equal to args[6] + auth-id: {auth_id}, }} }}) "#, @@ -474,6 +482,10 @@ fn create_event_info_data_code( reward_cycle = &args[1], reward_cycle_index = &args.get(2).unwrap_or(&Value::none()), pox_set_offset = pox_set_offset.replace("%height%", "burn-block-height"), + signer_sig = &args.get(3).unwrap_or(&Value::none()), + signer_key = &args.get(4).unwrap_or(&Value::none()), + max_amount = &args.get(5).unwrap_or(&Value::none()), + auth_id = &args.get(6).unwrap_or(&Value::none()), ) } "delegate-stx" => { diff --git a/stackslib/src/chainstate/stacks/boot/pox_4_tests.rs b/stackslib/src/chainstate/stacks/boot/pox_4_tests.rs index 4e58d2b8e9..be7675c700 100644 --- a/stackslib/src/chainstate/stacks/boot/pox_4_tests.rs +++ b/stackslib/src/chainstate/stacks/boot/pox_4_tests.rs @@ -4498,7 +4498,7 @@ fn stack_agg_increase() { .clone() .expect_u128() .unwrap(), - Some(alice_signature_increase), + Some(alice_signature_increase.clone()), &alice.public_key, u128::MAX, 1, @@ -4596,16 +4596,52 @@ fn stack_agg_increase() { &bob_err_increase_result_expected ); + let bob_aggregate_increase_tx = &tx_block.receipts.get(4).unwrap(); + // Fetch the aggregate increase result & check that value is true - let bob_aggregate_increase_result = &tx_block - .receipts - .get(4) - .unwrap() + let bob_aggregate_increase_result = bob_aggregate_increase_tx .result .clone() .expect_result_ok() .unwrap(); - assert_eq!(bob_aggregate_increase_result, &Value::Bool(true)); + assert_eq!(bob_aggregate_increase_result, Value::Bool(true)); + + let aggregation_increase_event = &bob_aggregate_increase_tx.events[0]; + + let expected_result = Value::okay(Value::Tuple( + TupleData::from_data(vec![ + ( + "stacker".into(), + Value::Principal(PrincipalData::from(bob.address.clone())), + ), + ("total-locked".into(), Value::UInt(min_ustx * 2)), + ]) + .unwrap(), + )) + .unwrap(); + + let increase_op_data = HashMap::from([ + ( + "signer-sig", + Value::some(Value::buff_from(alice_signature_increase).unwrap()).unwrap(), + ), + ( + "signer-key", + Value::buff_from(alice.public_key.to_bytes_compressed()).unwrap(), + ), + ("max-amount", Value::UInt(u128::MAX)), + ("auth-id", Value::UInt(1)), + ]); + + let common_data = PoxPrintFields { + op_name: "stack-aggregation-increase".to_string(), + stacker: Value::Principal(PrincipalData::from(bob.address.clone())), + balance: Value::UInt(1000000000000000000), + locked: Value::UInt(0), + burnchain_unlock_height: Value::UInt(0), + }; + + check_pox_print_event(&aggregation_increase_event, common_data, increase_op_data); // Check that Bob's second pool has an assigned reward index of 1 let bob_aggregate_commit_reward_index = &tx_block @@ -6502,7 +6538,7 @@ fn test_scenario_one() { // Bob solo stacker-signer setup let mut bob = StackerSignerInfo::new(); let default_initial_balances: u64 = 1_000_000_000_000_000_000; - let mut initial_balances = vec![ + let initial_balances = vec![ (alice.principal.clone(), default_initial_balances), (bob.principal.clone(), default_initial_balances), ]; @@ -6911,7 +6947,7 @@ fn test_scenario_two() { let mut dave = StackerSignerInfo::new(); let default_initial_balances = 1_000_000_000_000_000_000; - let mut initial_balances = vec![ + let initial_balances = vec![ (alice.principal.clone(), default_initial_balances), (bob.principal.clone(), default_initial_balances), (carl.principal.clone(), default_initial_balances), @@ -7252,7 +7288,7 @@ fn test_scenario_three() { // Bob stacker signer setup let mut bob = StackerSignerInfo::new(); // Carl service signer setup - let mut carl = StackerSignerInfo::new(); + let carl = StackerSignerInfo::new(); // David stacking pool operator setup let mut david = StackerSignerInfo::new(); // Eve pool stacker setup @@ -7729,7 +7765,7 @@ fn test_scenario_four() { let mut bob = StackerSignerInfo::new(); let default_initial_balances = 1_000_000_000_000_000_000; - let mut initial_balances = vec![ + let initial_balances = vec![ (alice.principal.clone(), default_initial_balances), (bob.principal.clone(), default_initial_balances), ]; @@ -8770,7 +8806,7 @@ fn test_scenario_five() { let mut mallory = StackerSignerInfo::new(); let default_initial_balances = 1_000_000_000_000_000_000; - let mut initial_balances = vec![ + let initial_balances = vec![ (alice.principal.clone(), default_initial_balances), (bob.principal.clone(), default_initial_balances), (carl.principal.clone(), default_initial_balances),