|
51 | 51 | createdAt: uint, ;; block height |
52 | 52 | caller: principal, ;; contract caller |
53 | 53 | creator: principal, ;; proposal creator (tx-sender) |
54 | | - startBlock: uint, ;; block height |
55 | | - endBlock: uint, ;; block height |
| 54 | + startBlockStx: uint, ;; block height for at-block calls |
| 55 | + startBlock: uint, ;; burn block height |
| 56 | + endBlock: uint, ;; burn block height |
56 | 57 | votesFor: uint, ;; total votes for |
57 | 58 | votesAgainst: uint, ;; total votes against |
58 | 59 | liquidTokens: uint, ;; liquid tokens |
|
94 | 95 | parameters: parameters, |
95 | 96 | creator: tx-sender, |
96 | 97 | liquidTokens: liquidTokens, |
| 98 | + startBlockStx: block-height, |
97 | 99 | startBlock: burn-block-height, |
98 | 100 | endBlock: (+ burn-block-height VOTING_PERIOD) |
99 | 101 | } |
|
105 | 107 | createdAt: burn-block-height, |
106 | 108 | caller: contract-caller, |
107 | 109 | creator: tx-sender, |
| 110 | + startBlockStx: block-height, |
108 | 111 | startBlock: burn-block-height, |
109 | 112 | endBlock: (+ burn-block-height VOTING_PERIOD), |
110 | 113 | votesFor: u0, |
|
122 | 125 | (let |
123 | 126 | ( |
124 | 127 | (proposalRecord (unwrap! (map-get? Proposals proposalId) ERR_PROPOSAL_NOT_FOUND)) |
125 | | - (proposalBlock (get startBlock proposalRecord)) |
| 128 | + (proposalBlock (get startBlockStx proposalRecord)) |
126 | 129 | (proposalBlockHash (unwrap! (get-block-hash proposalBlock) ERR_RETRIEVING_START_BLOCK_HASH)) |
127 | 130 | (senderBalance (unwrap! (at-block proposalBlockHash (contract-call? .aibtc-token get-balance tx-sender)) ERR_FETCHING_TOKEN_DATA)) |
128 | 131 | ) |
|
201 | 204 | (let |
202 | 205 | ( |
203 | 206 | (proposalRecord (unwrap! (map-get? Proposals proposalId) ERR_PROPOSAL_NOT_FOUND)) |
204 | | - (proposalBlockHash (unwrap! (get-block-hash (get startBlock proposalRecord)) ERR_RETRIEVING_START_BLOCK_HASH)) |
| 207 | + (proposalBlockHash (unwrap! (get-block-hash (get startBlockStx proposalRecord)) ERR_RETRIEVING_START_BLOCK_HASH)) |
205 | 208 | ) |
206 | 209 | (at-block proposalBlockHash (contract-call? .aibtc-token get-balance who)) |
207 | 210 | ) |
|
244 | 247 | )) |
245 | 248 | ) |
246 | 249 |
|
247 | | -;; get block hash by height |
248 | 250 | (define-private (get-block-hash (blockHeight uint)) |
249 | 251 | (get-block-info? id-header-hash blockHeight) |
250 | 252 | ) |
|
0 commit comments