feat: return block-height from withdraw? funcs

`stx-wtihdraw?`, `ft-withdraw?` and `nft-withdraw?` do not return any
meaningful value on success. When attempting to make a withdrawal, users
will need the block height in which the withdrawal occured in order to
perform the second stage of the withdraw (on the L1). This changeset
makes these withdraw functions return the block height for convenience.
This commit is contained in:
Brice Dobry
2023-03-07 17:16:33 -05:00
parent e23b94181e
commit c81dfd7fb6

View File

@@ -72,7 +72,8 @@
amount: amount,
asset-contract: (contract-of asset),
})
(contract-call? asset burn-for-withdrawal amount sender)
(try! (contract-call? asset burn-for-withdrawal amount sender))
(ok block-height)
)
)
@@ -84,7 +85,8 @@
id: id,
asset-contract: (contract-of asset),
})
(contract-call? asset burn-for-withdrawal id sender)
(try! (contract-call? asset burn-for-withdrawal id sender))
(ok block-height)
)
)
@@ -95,6 +97,7 @@
sender: sender,
amount: amount,
})
(stx-transfer? amount sender (as-contract tx-sender))
(try! (stx-transfer? amount sender (as-contract tx-sender)))
(ok block-height)
)
)