projects
/
crowdnode.js
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
29d1ebb
)
fix(generate): use Duff, not Dash... uhg 🤦♂️
author
AJ ONeal
<coolaj86@gmail.com>
Tue, 21 Jun 2022 06:28:57 +0000
(
00:28
-0600)
committer
AJ ONeal
<coolaj86@gmail.com>
Tue, 21 Jun 2022 06:28:57 +0000
(
00:28
-0600)
bin/crowdnode.js
patch
|
blob
|
history
diff --git
a/bin/crowdnode.js
b/bin/crowdnode.js
index a867b5663c19595c4d27742129c1f157adf55e1a..943eaa83ad6f071ca534a5b3f97d8765f674e59c 100755
(executable)
--- a/
bin/crowdnode.js
+++ b/
bin/crowdnode.js
@@
-301,11
+301,14
@@
async function generate(name) {
note = `\n(for pubkey address ${pub})`;
}
note = `\n(for pubkey address ${pub})`;
}
+ let testDash = 0.01;
+ let testDuff = toDuff(testDash);
+
let err = await Fs.access(filepath).catch(Object);
if (!err) {
// TODO show QR anyway
//wif = await Fs.readFile(filepath, 'utf8')
let err = await Fs.access(filepath).catch(Object);
if (!err) {
// TODO show QR anyway
//wif = await Fs.readFile(filepath, 'utf8')
- //showQr(pub,
0.01
);
+ //showQr(pub,
testDuff
);
console.info(`'${filepath}' already exists (will not overwrite)`);
process.exit(0);
return;
console.info(`'${filepath}' already exists (will not overwrite)`);
process.exit(0);
return;
@@
-314,13
+317,13
@@
async function generate(name) {
await Fs.writeFile(filepath, wif, "utf8").then(function () {
console.info(``);
console.info(
await Fs.writeFile(filepath, wif, "utf8").then(function () {
console.info(``);
console.info(
- `Use the QR Code below to load a test deposit of Đ
0.01
onto your staking key.`,
+ `Use the QR Code below to load a test deposit of Đ
${testDash}
onto your staking key.`,
);
console.info(``);
);
console.info(``);
- showQr(pub,
0.01
);
+ showQr(pub,
testDuff
);
console.info(``);
console.info(
console.info(``);
console.info(
- `Use the QR Code above to load a test deposit of Đ
0.01
onto your staking key.`,
+ `Use the QR Code above to load a test deposit of Đ
${testDash}
onto your staking key.`,
);
console.info(``);
console.info(`Generated ${filepath} ${note}`);
);
console.info(``);
console.info(`Generated ${filepath} ${note}`);
@@
-613,6
+616,10
@@
function toDash(duffs) {
return (duffs / DUFFS).toFixed(8);
}
return (duffs / DUFFS).toFixed(8);
}
+function toDuff(dash) {
+ return Math.round(parseFloat(dash) * DUFFS);
+}
+
// Run
main().catch(function (err) {
// Run
main().catch(function (err) {