|
894 | 894 | (asserts! (> reward-cycle (current-pox-reward-cycle))
|
895 | 895 | (err ERR_STACKING_INVALID_LOCK_PERIOD))
|
896 | 896 |
|
897 |
| - (let ((amount-ustx (get stacked-amount partial-stacked)) |
| 897 | + (let ((partial-amount-ustx (get stacked-amount partial-stacked)) |
898 | 898 | ;; reward-cycle must point to an existing record in reward-cycle-total-stacked
|
899 | 899 | ;; infallible; getting something from partial-stacked-by-cycle succeeded so this must succeed
|
900 |
| - (existing-total (unwrap-panic (map-get? reward-cycle-total-stacked { reward-cycle: reward-cycle }))) |
| 900 | + (existing-cycle-total (unwrap-panic (map-get? reward-cycle-total-stacked { reward-cycle: reward-cycle }))) |
901 | 901 | ;; reward-cycle and reward-cycle-index must point to an existing record in reward-cycle-pox-address-list
|
902 |
| - (existing-entry (unwrap! (map-get? reward-cycle-pox-address-list { reward-cycle: reward-cycle, index: reward-cycle-index }) |
| 902 | + (existing-entry-total (unwrap! (map-get? reward-cycle-pox-address-list { reward-cycle: reward-cycle, index: reward-cycle-index }) |
903 | 903 | (err ERR_DELEGATION_NO_REWARD_SLOT)))
|
904 |
| - (increased-ustx (+ (get total-ustx existing-entry) amount-ustx)) |
905 |
| - (total-ustx (+ (get total-ustx existing-total) amount-ustx))) |
| 904 | + (increased-entry-total (+ (get total-ustx existing-entry-total) partial-amount-ustx)) |
| 905 | + (increased-cycle-total (+ (get total-ustx existing-cycle-total) partial-amount-ustx))) |
906 | 906 |
|
907 | 907 | ;; must be stackable
|
908 |
| - (try! (minimal-can-stack-stx pox-addr increased-ustx reward-cycle u1)) |
| 908 | + (try! (minimal-can-stack-stx pox-addr increased-entry-total reward-cycle u1)) |
909 | 909 |
|
910 | 910 | ;; new total must exceed the stacking minimum
|
911 |
| - (asserts! (<= (get-stacking-minimum) increased-ustx) |
| 911 | + (asserts! (<= (get-stacking-minimum) increased-entry-total) |
912 | 912 | (err ERR_STACKING_THRESHOLD_NOT_MET))
|
913 | 913 |
|
914 | 914 | ;; there must *not* be a stacker entry (since this is a delegator)
|
|
920 | 920 | (err ERR_DELEGATION_WRONG_REWARD_SLOT))
|
921 | 921 |
|
922 | 922 | ;; Validate that amount is less than or equal to `max-amount`
|
923 |
| - (asserts! (>= max-amount increased-ustx) (err ERR_SIGNER_AUTH_AMOUNT_TOO_HIGH)) |
| 923 | + (asserts! (>= max-amount increased-entry-total) (err ERR_SIGNER_AUTH_AMOUNT_TOO_HIGH)) |
924 | 924 |
|
925 | 925 | ;; Verify signature from delegate that allows this sender for this cycle
|
926 | 926 | ;; 'lock-period' param set to one period, same as aggregation-commit-indexed
|
927 |
| - (try! (consume-signer-key-authorization pox-addr reward-cycle "agg-increase" u1 signer-sig signer-key increased-ustx max-amount auth-id)) |
| 927 | + (try! (consume-signer-key-authorization pox-addr reward-cycle "agg-increase" u1 signer-sig signer-key increased-entry-total max-amount auth-id)) |
928 | 928 |
|
929 | 929 | ;; update the pox-address list -- bump the total-ustx
|
930 | 930 | (map-set reward-cycle-pox-address-list
|
931 | 931 | { reward-cycle: reward-cycle, index: reward-cycle-index }
|
932 | 932 | { pox-addr: pox-addr,
|
933 |
| - total-ustx: increased-ustx, |
| 933 | + total-ustx: increased-entry-total, |
934 | 934 | stacker: none,
|
935 | 935 | signer: signer-key })
|
936 | 936 |
|
937 | 937 | ;; update the total ustx in this cycle
|
938 | 938 | (map-set reward-cycle-total-stacked
|
939 | 939 | { reward-cycle: reward-cycle }
|
940 |
| - { total-ustx: total-ustx }) |
| 940 | + { total-ustx: increased-cycle-total }) |
941 | 941 |
|
942 | 942 | ;; don't update the stacking-state map,
|
943 | 943 | ;; because it _already has_ this stacker's state
|
|
0 commit comments