Skip to content

Commit 3e5282f

Browse files
committed
More fun with parentheses.
1 parent f0a92a7 commit 3e5282f

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

core-contracts/contracts/multi-miner.clar

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,34 +92,34 @@
9292
;; are for the function by that name on this fork
9393
(define-private (check-registration (signatures (list 9 (buff 65)))
9494
(data {principal: principal, deposit-fn-name: (string-ascii 45), height: uint}) )
95-
(let ((registration-hash make-registration-hash data)
96-
(signer-principals (try! (fold verify-sign-helper signatures (ok { hash: registration-hash, signers: (list) })))) )
95+
(let ((registration-hash (make-registration-hash data))
96+
(signer-principals (try! (fold verify-sign-helper signatures (ok { hash: registration-hash, signers: (list) })))))
9797
;; TODO: perform checks on height?
9898
;; TODO: should we pass around the block-id as well to provide a meaningful error?
9999
;; check that the caller is a direct caller!
100-
(asserts! (is-eq tx-sender contract-caller) (err ERR_UNAUTHORIZED_CONTRACT_CALLER)))
100+
(asserts! (is-eq tx-sender contract-caller) (err ERR_UNAUTHORIZED_CONTRACT_CALLER))
101101
;; check that we have enough signatures
102-
(check-miners (append (get signers signer-principals) tx-sender)))
102+
(check-miners (append (get signers signer-principals) tx-sender))))
103103

104104
;; TODO: this needs to be ensure that the miner can't call it directly with an earlier height
105105
;; so it either needs to be private or we could check that the height is recent
106106
(define-private (make-registration-hash (data {principal: principal, deposit-fn-name: (string-ascii 45), height: uint}))
107-
(let ((block-id (get-block-info? id-header-hash (get hash-height data)))
108-
(data-buff (unwrap-panic (to-consensus-buff (merge data { block-id: block-id, multi-contract: CONTRACT_ADDRESS }))))
107+
(let ((block-id (get-block-info? id-header-hash (get height data)))
108+
(data-buff (unwrap-panic (to-consensus-buff? (merge data { block-id: block-id, multi-contract: CONTRACT_ADDRESS }))))
109109
(data-hash (sha256 data-buff))
110110
(structured-hash (sha256 (concat sip18-data-prefix data-hash))))
111111
structured-hash))
112112

113113
(define-read-only (make-ft-registration-hash (ft-contract <ft-trait>) (deposit-fn-name (string-ascii 45)))
114114
(let ((contract_principal (contract-of ft-contract))
115-
(structured-hash make-registration-hash
116-
{principal: contract_principal, deposit-fn-name: deposit-fn-name, height: block-height}))
115+
(structured-hash (make-registration-hash
116+
{principal: contract_principal, deposit-fn-name: deposit-fn-name, height: block-height})))
117117
{height: block-height, hash: structured-hash}))
118118

119119
(define-read-only (make-nft-registration-hash (nft-contract <nft-trait>) (deposit-fn-name (string-ascii 45)))
120120
(let ((contract_principal (contract-of nft-contract))
121-
(structured-hash make-registration-hash
122-
{principal: contract_principal, deposit-fn-name: deposit-fn-name, height: block-height}))
121+
(structured-hash (make-registration-hash
122+
{principal: contract_principal, deposit-fn-name: deposit-fn-name, height: block-height})))
123123
{height: block-height, hash: structured-hash}))
124124

125125
;; height is the block-height when the hash was created that was signed
@@ -128,20 +128,20 @@
128128
;; deposit-fn-name is on the L2
129129
(define-public (register-new-ft-contract (ft-contract <ft-trait>) (deposit-fn-name (string-ascii 45) )
130130
(height uint) (signatures (list 9 (buff 65))) )
131-
(let (contract_principal (contract-of ft-contract))
131+
(let ((contract_principal (contract-of ft-contract)))
132132
(try! (check-registration signatures
133-
{principal: contract_principal, deposit-fn-name: deposit-fn-name, height: height})))
133+
{principal: contract_principal, deposit-fn-name: deposit-fn-name, height: height}))
134134
;; execute the registration
135-
(as-contract (contract-call? .subnet register-new-ft-contract ft-contract deposit-fn-name)) )
135+
(as-contract (contract-call? .subnet register-new-ft-contract ft-contract deposit-fn-name)) ))
136136

137137
;; height is the block-height when the hash was created that was signed
138138
;; the purpose of this is to ensure that this is the same fork
139139
;; nft-contract is on the L1
140140
;; deposit-fn-name is on the L2
141141
(define-public (register-new-nft-contract (nft-contract <nft-trait>) (deposit-fn-name (string-ascii 45) )
142142
(height uint) (signatures (list 9 (buff 65))) )
143-
(let (contract_principal (contract-of nft-contract))
143+
(let ((contract_principal (contract-of nft-contract)))
144144
(try! (check-registration signatures
145-
{principal: contract_principal, deposit-fn-name: deposit-fn-name, height: height})))
145+
{principal: contract_principal, deposit-fn-name: deposit-fn-name, height: height}))
146146
;; execute the registration
147-
(as-contract (contract-call? .subnet register-new-nft-contract nft-contract deposit-fn-name)) )
147+
(as-contract (contract-call? .subnet register-new-nft-contract nft-contract deposit-fn-name)) ))

0 commit comments

Comments
 (0)