You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We updated the other tests to work with the L2 messages, but forgot to put a test fixture in for the AssetLock specifically.
Here's the code that can produce the signed payload, verified by virtue of being broadcast to the network and accepted.
letutxos=awaitDashTx.utils.rpc(rpcAuthUrl,"getaddressutxos",{addresses: [addr],});lettotal=DashTx.sum(utxos);console.log();console.log(`utxos (${total})`);console.log(utxos);// TODO which hd paths to use for which addresses?letcreditOutputs=[{satoshis: total-10000,pubKeyHash: pkh}];lettotalCredits=DashTx.sum(creditOutputs);letburnOutput={satoshis: totalCredits,pubKeyHash: pkh};//@ts-ignore - TODO add typesletassetLockScript=DashPlatform.Tx.packAssetLock({
creditOutputs,});lettxDraft={version: L1_VERSION_PLATFORM,type: TYPE_ASSET_LOCK,inputs: utxos,outputs: [burnOutput],extraPayload: assetLockScript,};console.log();console.log(`txDraft:`);console.log(txDraft);txDraft.inputs.sort(DashTx.sortInputs);txDraft.outputs.sort(DashTx.sortOutputs);letvout=txDraft.outputs.indexOf(burnOutput);letvin=0;lettxSigHash=DashTx.createForSig(txDraft,vin,DashTx.SIGHASH_DEFAULT);lettxHex=DashTx.serialize(txSigHash,_sigHashType);console.log(txHex);lettxSigned=awaitdashTx.hashAndSignAll(txDraft);console.log();console.log(`txSigned:`);console.log(txSigned);lettxid=awaitDashTx.utils.rpc(rpcAuthUrl,"sendrawtransaction",txSigned.transaction,);
The text was updated successfully, but these errors were encountered:
We updated the other tests to work with the L2 messages, but forgot to put a test fixture in for the AssetLock specifically.
Here's the code that can produce the signed payload, verified by virtue of being broadcast to the network and accepted.
The text was updated successfully, but these errors were encountered: