File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,8 @@ async function main() {
53
53
let gobjCollateralBytes = DashGov . serializeForCollateralTx ( gobj ) ;
54
54
let gobjCollateralHex = DashGov . utils . bytesToHex ( gobjCollateralBytes ) ;
55
55
56
- let crypto = globalThis . crypto ;
57
- let hash1 = await crypto . subtle . digest ( "SHA-256" , gobjCollateralBytes ) ;
58
- let gobjCollateralHashBuf = await crypto . subtle . digest ( "SHA-256" , hash1 ) ;
59
- let gobjCollateralHashBytes = new Uint8Array ( gobjCollateralHashBuf ) ;
60
- let gobjCollateralHashHex = DashGov . utils . bytesToHex ( gobjCollateralHashBytes ) ;
56
+ let gobjHashBytes = await DashGov . proposal . doubleSha256 ( gobjCollateralBytes ) ;
57
+ let gobjId = DashGov . utils . bytesToHex ( gobjHashBytes ) ;
61
58
62
59
console . log (
63
60
"gobject prepare" ,
@@ -70,7 +67,7 @@ async function main() {
70
67
console . log ( `# ${ gobjCollateralHex } ` ) ;
71
68
console . log ( ) ;
72
69
console . log ( `# GObject Hash ID (will be found in collateral tx memo)` ) ;
73
- console . log ( `# ${ gobjCollateralHashHex } ` ) ;
70
+ console . log ( `# ${ gobjId } ` ) ;
74
71
}
75
72
76
73
main ( )
You can’t perform that action at this time.
0 commit comments