Skip to content

Commit aef25d2

Browse files
committed
fix: hex-encode the binary (not the hex)
1 parent 0b34edd commit aef25d2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

demo-static.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,11 @@ async function main() {
255255
// },
256256
// ),
257257
// not sure what "previous outpoint" this refers to, as its not the one in the transaction
258-
instant_lock:
258+
instant_lock: DashTx.utils.hexToBytes(
259259
"01011dbbda5861b12d7523f20aa5e0d42f52de3dcd2d5c2fe919ba67b59f050d206e0000000058c444dd0957767db2c0adea69fd861792bfa75c7e364d83fe85bebebc2a08b436a56617591a6a89237bada6af1f9b46eba47b5d89a8c4e49ff2d0236182307c8967c46529a967b3822e1ba8a173066296d02593f0f59b3a78a30a7eef9c8a120847729e62e4a32954339286b79fe7590221331cd28d576887a263f45b595d499272f656c3f5176987c976239cac16f972d796ad82931d532102a4f95eec7d80",
260-
transaction: txProofHex,
260+
),
261+
transaction: DashTx.utils.hexToBytes(txProofHex),
262+
// output_index: DashTx.utils.hexToBytes(vout),
261263
output_index: vout,
262264
};
263265
return assetLockInstantProof;
@@ -389,6 +391,7 @@ async function main() {
389391
let bcAb = Bincode.encode(Bincode.StateTransition, stateTransition, {
390392
signable: true,
391393
});
394+
console.log(`bc (ready-to-sign) AB:`, bcAb);
392395
let bc = new Uint8Array(bcAb);
393396
console.log(`bc (ready-to-sign):`);
394397
console.log(DashTx.utils.bytesToHex(bc));
@@ -549,7 +552,7 @@ async function getKnownIdentityKeys(masterKey, otherKey) {
549552
function getIdentityTransitionKeys(identityKeys) {
550553
let stKeys = [];
551554
for (let key of identityKeys) {
552-
let data = bytesToBase64(key.publicKey);
555+
// let data = bytesToBase64(key.publicKey);
553556
let stKey = {
554557
$version: "0",
555558
id: key.id,
@@ -559,7 +562,8 @@ function getIdentityTransitionKeys(identityKeys) {
559562
contract_bounds: null,
560563
// readOnly: key.readOnly,
561564
read_only: key.readOnly || false,
562-
data: data,
565+
// data: data,
566+
data: key.publicKey,
563567
// signature: "TODO",
564568
};
565569
// if ("readOnly" in key) {

0 commit comments

Comments
 (0)