-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
brady.ouren
committed
Dec 18, 2024
1 parent
8b3ff87
commit 5736d15
Showing
5 changed files
with
115 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
components/clarinet-format/tests/golden-intended/match-or.clar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
;; Determines if a character is a vowel (a, e, i, o, u, and y). | ||
(define-private (is-vowel | ||
(char (buff 1)) | ||
) | ||
(or | ||
(is-eq char 0x61) ;; a | ||
(is-eq char 0x65) ;; e | ||
(is-eq char 0x69) ;; i | ||
(is-eq char 0x6f) ;; o | ||
(is-eq char 0x75) ;; u | ||
(is-eq char 0x79) ;; y | ||
) | ||
) | ||
|
||
;; pre comment | ||
(define-private (something) | ||
(match opt | ||
value | ||
(ok (handle-new-value value)) | ||
(ok 1) | ||
) | ||
) | ||
|
||
(define-read-only (is-borroweable-isolated | ||
(asset principal) | ||
) | ||
(match (index-of? (contract-call? pool-reserve-data get-borroweable-isolated-read) asset) | ||
res | ||
true | ||
false | ||
) | ||
) |
17 changes: 17 additions & 0 deletions
17
components/clarinet-format/tests/golden-intended/tuple.clar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(define-public (set-user-reserve | ||
(user principal) | ||
(asset principal) | ||
(state { | ||
principal-borrow-balance: uint, | ||
last-variable-borrow-cumulative-index: uint, | ||
origination-fee: uint, | ||
stable-borrow-rate: uint, | ||
last-updated-block: uint, | ||
use-as-collateral: bool | ||
}) | ||
) | ||
(begin | ||
(asserts! (is-lending-pool contract-caller) ERR_UNAUTHORIZED) | ||
(contract-call? pool-reserve-data set-user-reserve-data user asset state) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
;; Determines if a character is a vowel (a, e, i, o, u, and y). | ||
(define-private (is-vowel (char (buff 1))) | ||
(or | ||
(is-eq char 0x61) ;; a | ||
(is-eq char 0x65) ;; e | ||
(is-eq char 0x69) ;; i | ||
(is-eq char 0x6f) ;; o | ||
(is-eq char 0x75) ;; u | ||
(is-eq char 0x79) ;; y | ||
) | ||
) | ||
|
||
;; pre comment | ||
(define-private (something) | ||
(match opt value (ok (handle-new-value value)) (ok 1)) | ||
) | ||
|
||
(define-read-only (is-borroweable-isolated (asset principal)) | ||
(match (index-of? (contract-call? .pool-reserve-data get-borroweable-isolated-read) asset) | ||
res true | ||
false)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(define-public (set-user-reserve | ||
(user principal) | ||
(asset principal) | ||
(state | ||
(tuple | ||
(principal-borrow-balance uint) | ||
(last-variable-borrow-cumulative-index uint) | ||
(origination-fee uint) | ||
(stable-borrow-rate uint) | ||
(last-updated-block uint) | ||
(use-as-collateral bool) | ||
) | ||
)) | ||
(begin | ||
(asserts! (is-lending-pool contract-caller) ERR_UNAUTHORIZED) | ||
(contract-call? .pool-reserve-data set-user-reserve-data user asset state) | ||
) | ||
) |