Skip to content

Commit

Permalink
name updated
Browse files Browse the repository at this point in the history
  • Loading branch information
setzeus committed Nov 20, 2024
1 parent 3924a2b commit 98cb213
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
14 changes: 7 additions & 7 deletions contracts/contracts/sbtc-registry.clar
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
;; If status is `none`, the request is pending.
;; Otherwise, the boolean value indicates whether
;; the deposit was accepted.
(define-map withdrawal-status uint {
(define-map is-accepted uint {
status: bool,
sweep-txid: (optional (buff 32)),
sweep-burn-hash: (optional (buff 32)),
Expand Down Expand Up @@ -77,12 +77,12 @@

;; Read-only functions
;; Get a withdrawal request by its ID.
;; This function returns the fields of the withrawal
;; This function returns the fields of the withdrawal
;; request, along with its status.
(define-read-only (get-withdrawal-request (id uint))
(match (map-get? withdrawal-requests id)
request (some (merge request {
status: (map-get? withdrawal-status id)
status: (map-get? is-accepted id)
}))
none
)
Expand Down Expand Up @@ -167,7 +167,7 @@
)

;; Complete withdrawal request by noting the acceptance in the
;; withdrawal-status state map.
;; is-accepted state map.
;;
;; This function will emit a print event with the topic
;; "withdrawal-accept".
Expand All @@ -185,7 +185,7 @@
(begin
(try! (is-protocol-caller))
;; Mark the withdrawal as completed
(map-insert withdrawal-status request-id {
(map-insert is-accepted request-id {
status: true,
sweep-txid: (some sweep-txid),
sweep-burn-hash: (some burn-hash),
Expand All @@ -207,7 +207,7 @@
)

;; Complete withdrawal request by noting the rejection in the
;; withdrawal-status state map.
;; is-accepted state map.
;;
;; This function will emit a print event with the topic
;; "withdrawal-reject".
Expand All @@ -219,7 +219,7 @@
(begin
(try! (is-protocol-caller))
;; Mark the withdrawal as completed
(map-insert withdrawal-status request-id {
(map-insert is-accepted request-id {
status: false,
sweep-txid: none,
sweep-burn-hash: none,
Expand Down
52 changes: 26 additions & 26 deletions contracts/tests/clarigen-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,32 @@ export const contracts = {
sweepTxid: Uint8Array;
}
>,
isAccepted: {
name: "is-accepted",
key: "uint128",
value: {
tuple: [
{ name: "status", type: "bool" },
{
name: "sweep-burn-hash",
type: { optional: { buffer: { length: 32 } } },
},
{ name: "sweep-burn-height", type: { optional: "uint128" } },
{
name: "sweep-txid",
type: { optional: { buffer: { length: 32 } } },
},
],
},
} as TypedAbiMap<
number | bigint,
{
status: boolean;
sweepBurnHash: Uint8Array | null;
sweepBurnHeight: bigint | null;
sweepTxid: Uint8Array | null;
}
>,
multiSigAddress: {
name: "multi-sig-address",
key: "principal",
Expand Down Expand Up @@ -1113,32 +1139,6 @@ export const contracts = {
sender: string;
}
>,
withdrawalStatus: {
name: "withdrawal-status",
key: "uint128",
value: {
tuple: [
{ name: "status", type: "bool" },
{
name: "sweep-burn-hash",
type: { optional: { buffer: { length: 32 } } },
},
{ name: "sweep-burn-height", type: { optional: "uint128" } },
{
name: "sweep-txid",
type: { optional: { buffer: { length: 32 } } },
},
],
},
} as TypedAbiMap<
number | bigint,
{
status: boolean;
sweepBurnHash: Uint8Array | null;
sweepBurnHeight: bigint | null;
sweepTxid: Uint8Array | null;
}
>,
},
variables: {
ERR_AGG_PUBKEY_REPLAY: {
Expand Down

0 comments on commit 98cb213

Please sign in to comment.