Skip to content

Commit

Permalink
fix: incorrect arg index in synthetic event
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Feb 2, 2024
1 parent a7c5984 commit 5c14a44
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions pox-locking/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fn create_event_info_data_code(
lock_period = &args[3],
pox_addr = &args[1],
start_burn_height = &args[2],
signer_key = &args.get(3).map_or("none".to_string(), |v| v.to_string()),
signer_key = &args.get(4).unwrap_or(&Value::none()),
)
}
"delegate-stack-stx" => {
Expand Down Expand Up @@ -295,9 +295,7 @@ fn create_event_info_data_code(
extend_count = &args[2]
)
}
"stack-aggregation-commit"
| "stack-aggregation-commit-indexed"
| "stack-aggregation-increase" => {
"stack-aggregation-commit" | "stack-aggregation-commit-indexed" => {
format!(
r#"
{{
Expand All @@ -321,7 +319,34 @@ fn create_event_info_data_code(
"#,
pox_addr = &args[0],
reward_cycle = &args[1],
signer_key = &args.get(2).map_or("none".to_string(), |v| v.to_string()),
signer_key = &args.get(2).unwrap_or(&Value::none()),
)
}
"stack-aggregation-increase" => {
format!(
r#"
{{
data: {{
;; pox addr locked up
;; equal to args[0] in all methods
pox-addr: {pox_addr},
;; reward cycle locked up
;; equal to args[1] in all methods
reward-cycle: {reward_cycle},
;; amount locked behind this PoX address by this method
amount-ustx: (get stacked-amount
(unwrap-panic (map-get? logged-partial-stacked-by-cycle
{{ pox-addr: {pox_addr}, sender: tx-sender, reward-cycle: {reward_cycle} }}))),
;; delegator (this is the caller)
delegator: tx-sender,
;; equal to args[2]
reward-cycle-index: {reward_cycle_index}
}}
}}
"#,
pox_addr = &args[0],
reward_cycle = &args[1],
reward_cycle_index = &args.get(2).unwrap_or(&Value::none()),
)
}
"delegate-stx" => {
Expand Down

0 comments on commit 5c14a44

Please sign in to comment.