@@ -21,7 +21,7 @@ async function main() {
21
21
console . info ( "" ) ;
22
22
console . info ( "USAGE" ) ;
23
23
console . info (
24
- " dashgov draft-proposal [start period] [num periods] <DASH-per-period> <proposal-url> <name> <payment-addr> <./collateral -key.wif> [network]" ,
24
+ " dashgov draft-proposal [start period] [num periods] <DASH-per-period> <proposal-url> <name> <payment-addr> <./burn -key.wif> [network]" ,
25
25
) ;
26
26
console . info ( "" ) ;
27
27
console . info ( "EXAMPLE" ) ;
@@ -43,11 +43,11 @@ async function main() {
43
43
let proposalUrl = process . argv [ 5 ] || "" ;
44
44
let proposalName = process . argv [ 6 ] || "" ;
45
45
let paymentAddr = process . argv [ 7 ] || "" ;
46
- let collateralWifPath = process . argv [ 8 ] || "" ;
47
- let collateralWif = "" ;
48
- if ( collateralWifPath ) {
49
- collateralWif = await Fs . readFile ( collateralWifPath , "utf8" ) ;
50
- collateralWif = collateralWif . trim ( ) ;
46
+ let burnWifPath = process . argv [ 8 ] || "" ;
47
+ let burnWif = "" ;
48
+ if ( burnWifPath ) {
49
+ burnWif = await Fs . readFile ( burnWifPath , "utf8" ) ;
50
+ burnWif = burnWif . trim ( ) ;
51
51
}
52
52
53
53
let rpcConfig = {
@@ -251,22 +251,22 @@ async function main() {
251
251
let gobj = DashGov . proposal . draft ( now , selected . start . startMs , gobjData , { } ) ;
252
252
console . log ( gobj ) ;
253
253
254
- let gobjCollateralBytes = DashGov . serializeForCollateralTx ( gobj ) ;
255
- let gobjCollateralHex = DashGov . utils . bytesToHex ( gobjCollateralBytes ) ;
254
+ let gobjBurnBytes = DashGov . serializeForBurnTx ( gobj ) ;
255
+ let gobjBurnHex = DashGov . utils . bytesToHex ( gobjBurnBytes ) ;
256
256
257
- let gobjHashBytes = await DashGov . utils . doubleSha256 ( gobjCollateralBytes ) ;
257
+ let gobjHashBytes = await DashGov . utils . doubleSha256 ( gobjBurnBytes ) ;
258
258
let gobjId = DashGov . utils . hashToId ( gobjHashBytes ) ;
259
259
260
260
let gobjHashBytesReverse = gobjHashBytes . slice ( ) ;
261
261
gobjHashBytesReverse = gobjHashBytesReverse . reverse ( ) ;
262
262
let gobjIdForward = DashGov . utils . hashToId ( gobjHashBytesReverse ) ;
263
263
264
264
console . log ( "" ) ;
265
- console . log ( "GObject Serialization (for hash for collateral memo)" ) ;
266
- console . log ( gobjCollateralHex ) ;
265
+ console . log ( "GObject Serialization (for hash for burn memo)" ) ;
266
+ console . log ( gobjBurnHex ) ;
267
267
268
268
console . log ( "" ) ;
269
- console . log ( "(Collateralized ) GObject ID (for op return memo)" ) ;
269
+ console . log ( "(Burnable ) GObject ID (for op return memo)" ) ;
270
270
console . log ( gobjIdForward ) ;
271
271
console . log ( "GObject ID (for 'gobject get <gobj-id>')" ) ;
272
272
console . log ( gobjId ) ;
@@ -277,7 +277,7 @@ async function main() {
277
277
* @param {Number } i
278
278
*/
279
279
getPrivateKey : async function ( txInput , i ) {
280
- return DashKeys . wifToPrivKey ( collateralWif , { version : network } ) ;
280
+ return DashKeys . wifToPrivKey ( burnWif , { version : network } ) ;
281
281
} ,
282
282
283
283
/**
@@ -316,19 +316,19 @@ async function main() {
316
316
let dashTx = DashTx . create ( keyUtils ) ;
317
317
318
318
// dash-cli -testnet getaddressutxos '{"addresses":["yT6GS8qPrhsiiLHEaTWPYJMwfPPVt2SSFC"]}'
319
- let collateralAddr = await DashKeys . wifToAddr ( collateralWif , {
319
+ let burnAddr = await DashKeys . wifToAddr ( burnWif , {
320
320
version : network ,
321
321
} ) ;
322
322
323
323
console . log ( "" ) ;
324
- console . log ( "Collateral Address (source of 1 DASH network fee):" ) ;
325
- console . log ( collateralAddr ) ;
324
+ console . log ( "Burn Address (source of 1 DASH network fee):" ) ;
325
+ console . log ( burnAddr ) ;
326
326
327
327
let txid = "" ;
328
328
let txInfoSigned ;
329
329
{
330
330
let utxosResult = await rpc . getaddressutxos ( {
331
- addresses : [ collateralAddr ] ,
331
+ addresses : [ burnAddr ] ,
332
332
} ) ;
333
333
// TODO make sure there's just 1
334
334
// @type {Array<DashTx.TxInput> } */
@@ -342,11 +342,11 @@ async function main() {
342
342
//
343
343
344
344
console . log ( "" ) ;
345
- console . log ( "Signed Collateral Transaction (ready for broadcast):" ) ;
345
+ console . log ( "Signed Burn Transaction (ready for broadcast):" ) ;
346
346
console . log ( txInfoSigned . transaction ) ;
347
347
348
348
console . log ( "" ) ;
349
- console . log ( "Signed Collateral Transaction ID:" ) ;
349
+ console . log ( "Signed Burn Transaction ID:" ) ;
350
350
txid = await DashTx . getId ( txInfoSigned . transaction ) ;
351
351
console . log ( txid ) ;
352
352
}
@@ -443,7 +443,7 @@ async function main() {
443
443
// @ts -ignore - code exists
444
444
let code = err . code ;
445
445
if ( code === E_INVALID_COLLATERAL ) {
446
- // wait for collateral to become valid
446
+ // wait for burn to become valid
447
447
console . error ( code , err . message ) ;
448
448
return null ;
449
449
}
0 commit comments