Skip to content

Commit

Permalink
fixed both issues
Browse files Browse the repository at this point in the history
  • Loading branch information
setzeus committed Nov 28, 2024
1 parent c658f06 commit 2a3b9eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
4 changes: 2 additions & 2 deletions contracts/contracts/sbtc-deposit.clar
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
(try! (contract-call? .sbtc-token protocol-mint amount recipient))

;; Complete the deposit
(ok (contract-call? .sbtc-registry complete-deposit txid vout-index amount recipient burn-hash burn-height sweep-txid))
(contract-call? .sbtc-registry complete-deposit txid vout-index amount recipient burn-hash burn-height sweep-txid)
)
)

Expand Down Expand Up @@ -98,7 +98,7 @@
(match helper-response
index
(begin
(try! (unwrap! (complete-deposit-wrapper (get txid deposit) (get vout-index deposit) (get amount deposit) (get recipient deposit) (get burn-hash deposit) (get burn-height deposit) (get sweep-txid deposit)) (err (+ ERR_DEPOSIT_INDEX_PREFIX (+ u10 index)))))
(unwrap! (complete-deposit-wrapper (get txid deposit) (get vout-index deposit) (get amount deposit) (get recipient deposit) (get burn-hash deposit) (get burn-height deposit) (get sweep-txid deposit)) (err (+ ERR_DEPOSIT_INDEX_PREFIX (+ u10 index))))
(ok (+ index u1))
)
err-response
Expand Down
2 changes: 1 addition & 1 deletion contracts/contracts/sbtc-withdrawal.clar
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
;; Validate the `version`
(asserts! (<= version-int MAX_ADDRESS_VERSION) ERR_INVALID_ADDR_VERSION)
;; Validate the length of `hashbytes`
(asserts! (if (<= (buff-to-uint-be version) MAX_ADDRESS_VERSION_BUFF_20)
(asserts! (if (<= version-int MAX_ADDRESS_VERSION_BUFF_20)
;; If version is <= 4, then hashbytes must be 20 bytes
(is-eq (len hashbytes) u20)
;; Otherwise, hashbytes must be 32 bytes
Expand Down
11 changes: 2 additions & 9 deletions contracts/tests/clarigen-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,7 @@ export const contracts = {
{ name: "burn-height", type: "uint128" },
{ name: "sweep-txid", type: { buffer: { length: 32 } } },
],
outputs: {
type: {
response: {
ok: { response: { ok: "bool", error: "uint128" } },
error: "uint128",
},
},
},
outputs: { type: { response: { ok: "bool", error: "uint128" } } },
} as TypedAbiFunction<
[
txid: TypedAbiArg<Uint8Array, "txid">,
Expand All @@ -566,7 +559,7 @@ export const contracts = {
burnHeight: TypedAbiArg<number | bigint, "burnHeight">,
sweepTxid: TypedAbiArg<Uint8Array, "sweepTxid">,
],
Response<Response<boolean, bigint>, bigint>
Response<boolean, bigint>
>,
completeDepositsWrapper: {
name: "complete-deposits-wrapper",
Expand Down

0 comments on commit 2a3b9eb

Please sign in to comment.