Skip to content

Commit 20b5ac0

Browse files
committed
f: feat: add CLI tool to submit proposal
1 parent c426f1d commit 20b5ac0

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

bin/gobject-prepare.js

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -299,22 +299,9 @@ async function main() {
299299
let dashTx = DashTx.create(keyUtils);
300300

301301
// dash-cli -testnet getaddressutxos '{"addresses":["yT6GS8qPrhsiiLHEaTWPYJMwfPPVt2SSFC"]}'
302-
// TODO see https://github.com/dashhive/DashKeys.js/issues/26
303-
//let collateralAddr = DashKeys.wifToAddr(collateralWif, {
304-
let collateralParts = await DashKeys.decode(collateralWif, {
305-
version: "ef",
306-
validate: true,
307-
});
308-
let collateralPrivBytes = DashKeys.utils.hexToBytes(
309-
//@ts-ignore - bad types internally
310-
collateralParts.privateKey,
311-
);
312-
let collateralPubBytes =
313-
await DashKeys.utils.toPublicKey(collateralPrivBytes);
314-
let collateralAddr = await DashKeys.pubkeyToAddr(collateralPubBytes, {
302+
let collateralAddr = await DashKeys.wifToAddr(collateralWif, {
315303
version: "testnet",
316304
});
317-
// end testnet workaround
318305

319306
console.log("");
320307
console.log("Collateral Address (source of 1 DASH network fee):");
@@ -348,14 +335,13 @@ async function main() {
348335
txid = await DashTx.getId(txInfoSigned.transaction);
349336
console.log(txid);
350337

351-
//console.log(DashGov.PROPOSAL_FEE_RATE);
352-
let txResult = await rpc.request("/", {
353-
method: "sendrawtransaction",
354-
params: [txInfoSigned.transaction],
355-
});
356-
console.log("");
357-
console.log("Transaction sent:");
358-
console.log(txResult);
338+
let txResult = await rpc.request("/", {
339+
method: "sendrawtransaction",
340+
params: [txInfoSigned.transaction],
341+
});
342+
console.log("");
343+
console.log("Transaction sent:");
344+
console.log(txResult);
359345
}
360346

361347
for (;;) {

0 commit comments

Comments
 (0)