mirror of
https://github.com/alexgo-io/stacks-subnets.git
synced 2026-01-13 08:40:49 +08:00
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:
@@ -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)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user