Skip to content

Commit b775a1c

Browse files
committed
updated confusing var names
1 parent e0d9014 commit b775a1c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

stackslib/src/chainstate/stacks/boot/pox-4.clar

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -894,21 +894,21 @@
894894
(asserts! (> reward-cycle (current-pox-reward-cycle))
895895
(err ERR_STACKING_INVALID_LOCK_PERIOD))
896896

897-
(let ((amount-ustx (get stacked-amount partial-stacked))
897+
(let ((partial-amount-ustx (get stacked-amount partial-stacked))
898898
;; reward-cycle must point to an existing record in reward-cycle-total-stacked
899899
;; 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 })))
901901
;; 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 })
903903
(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)))
906906

907907
;; 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))
909909

910910
;; new total must exceed the stacking minimum
911-
(asserts! (<= (get-stacking-minimum) increased-ustx)
911+
(asserts! (<= (get-stacking-minimum) increased-entry-total)
912912
(err ERR_STACKING_THRESHOLD_NOT_MET))
913913

914914
;; there must *not* be a stacker entry (since this is a delegator)
@@ -920,24 +920,24 @@
920920
(err ERR_DELEGATION_WRONG_REWARD_SLOT))
921921

922922
;; 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))
924924

925925
;; Verify signature from delegate that allows this sender for this cycle
926926
;; '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))
928928

929929
;; update the pox-address list -- bump the total-ustx
930930
(map-set reward-cycle-pox-address-list
931931
{ reward-cycle: reward-cycle, index: reward-cycle-index }
932932
{ pox-addr: pox-addr,
933-
total-ustx: increased-ustx,
933+
total-ustx: increased-entry-total,
934934
stacker: none,
935935
signer: signer-key })
936936

937937
;; update the total ustx in this cycle
938938
(map-set reward-cycle-total-stacked
939939
{ reward-cycle: reward-cycle }
940-
{ total-ustx: total-ustx })
940+
{ total-ustx: increased-cycle-total })
941941

942942
;; don't update the stacking-state map,
943943
;; because it _already has_ this stacker's state

0 commit comments

Comments
 (0)