@stacks/rendezvous 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/citizen.js +8 -10
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/citizen.js
CHANGED
|
@@ -379,16 +379,14 @@ const restoreSbtcBalances = (simnet, sbtcBalancesMap) => {
|
|
|
379
379
|
* @param sweepTxId A unique hex to use for the deposit.
|
|
380
380
|
*/
|
|
381
381
|
const mintSbtc = (simnet, amountSats, recipient, txId, sweepTxId) => {
|
|
382
|
-
// Calling `get-burn-
|
|
383
|
-
// empty
|
|
384
|
-
|
|
385
|
-
|
|
382
|
+
// Calling `get-burn-block-info?` only works for past burn heights. We mine
|
|
383
|
+
// one empty Bitcoin block if the initial height is 0 and use the previous
|
|
384
|
+
// burn height to retrieve the burn header hash.
|
|
385
|
+
if (simnet.burnBlockHeight === 0) {
|
|
386
|
+
simnet.mineEmptyBurnBlock();
|
|
386
387
|
}
|
|
387
|
-
const
|
|
388
|
-
const burnHash = simnet.
|
|
389
|
-
// (height uint)
|
|
390
|
-
transactions_1.Cl.uint(previousStacksHeight),
|
|
391
|
-
], simnet.deployer).result;
|
|
388
|
+
const previousBurnHeight = simnet.burnBlockHeight - 1;
|
|
389
|
+
const burnHash = (0, transactions_1.hexToCV)(simnet.runSnippet(`(get-burn-block-info? header-hash u${previousBurnHeight})`));
|
|
392
390
|
if (burnHash === null || burnHash.type === transactions_1.ClarityType.OptionalNone) {
|
|
393
391
|
throw new Error("Something went wrong trying to retrieve the burn header.");
|
|
394
392
|
}
|
|
@@ -404,7 +402,7 @@ const mintSbtc = (simnet, amountSats, recipient, txId, sweepTxId) => {
|
|
|
404
402
|
// (burn-hash (buff 32))
|
|
405
403
|
burnHash.value,
|
|
406
404
|
// (burn-height uint)
|
|
407
|
-
transactions_1.Cl.uint(
|
|
405
|
+
transactions_1.Cl.uint(previousBurnHeight),
|
|
408
406
|
// (sweep-txid (buff 32))
|
|
409
407
|
transactions_1.Cl.bufferFromHex(sweepTxId),
|
|
410
408
|
], "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4").result);
|
package/dist/package.json
CHANGED