Skip to content

Commit f2a07f5

Browse files
committed
chore: fmt!
1 parent 46f93b6 commit f2a07f5

4 files changed

Lines changed: 32 additions & 30 deletions

File tree

src/bin/cli/network.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,19 +419,20 @@ async function stakes(options = {}) {
419419
async function supplyInfo(options = {}) {
420420
const reporter = new Witnet.JsonRpcProvider(options?.provider || process.env.WITNET_SDK_PROVIDER_URL);
421421
const data = await reporter.supplyInfo();
422-
console.info(`> Supply info at epoch ${
423-
helpers.colors.white(helpers.commas(data.epoch))
424-
}:`);
422+
console.info(`> Supply info at epoch ${helpers.colors.white(helpers.commas(data.epoch))}:`);
425423
const records = [];
426424
records.push(["Minted blocks", `${helpers.toFixedTrunc((100 * data.blocks_minted) / (data.epoch - 1), 1)} %`]);
427425
records.push(["Minted rewards", helpers.whole_wits(data.blocks_minted_reward, 2)]);
428426
if (data.current_staked_supply) {
429427
records.push(["Staked supply", helpers.whole_wits(data.current_staked_supply, 2)]);
430428
}
431-
records.push(["Circulating supply", helpers.whole_wits(
432-
BigInt(data.genesis_supply) + BigInt(data.blocks_minted_reward) - BigInt(data.current_staked_supply),
433-
2
434-
)]);
429+
records.push([
430+
"Circulating supply",
431+
helpers.whole_wits(
432+
BigInt(data.genesis_supply) + BigInt(data.blocks_minted_reward) - BigInt(data.current_staked_supply),
433+
2,
434+
),
435+
]);
435436
helpers.traceTable(records, {
436437
headlines: [":KPI", "VALUE"],
437438
colors: [helpers.colors.mgreen, helpers.colors.myellow],

src/bin/helpers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ export function cmd(timeout, ...commands) {
141141
console.debug("=> Killing process tree with PID:", child.pid);
142142
console.debug(" Command:", `${bin} ${args.join(" ")}`);
143143
if (!child.pid) return;
144-
kill(child.pid, (err) => { if (err) console.debug(" Error:", err) });
144+
kill(child.pid, (err) => {
145+
if (err) console.debug(" Error:", err);
146+
});
145147
};
146148

147149
const timer =

src/lib/rpc/nodes.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,14 @@ export class JsonRpcNodeFarm extends JsonRpcProvider implements IJsonRpcNodeFarm
328328

329329
/// Get supply info
330330
public async supplyInfo2(): Promise<SupplyInfo2 | undefined> {
331-
return this.addresses()
332-
.then(async (addresses: Record<string, Error | string>) => {
333-
return Promise.all(
334-
Object.entries(addresses).map(async ([url,]) => {
335-
return this.callApiMethod<SupplyInfo2>(url, Methods.GetSupplyInfo2)
336-
})
337-
).then((supplies: Array<SupplyInfo2>) => {
338-
return supplies.find(result => !(result instanceof Error))
339-
})
340-
})
331+
return this.addresses().then(async (addresses: Record<string, Error | string>) => {
332+
return Promise.all(
333+
Object.entries(addresses).map(async ([url]) => {
334+
return this.callApiMethod<SupplyInfo2>(url, Methods.GetSupplyInfo2);
335+
}),
336+
).then((supplies: Array<SupplyInfo2>) => {
337+
return supplies.find((result) => !(result instanceof Error));
338+
});
339+
});
341340
}
342341
}

src/lib/rpc/types.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -512,18 +512,18 @@ export type SuperblockReport = {
512512

513513
export type SupplyInfo = {
514514
//Current epoch
515-
epoch: u32,
516-
//Current time
517-
current_time: u64,
518-
//Number of blocks minted
519-
blocks_minted: u32,
520-
//WIT minted through block creation
521-
blocks_minted_reward: u64,
522-
//Current staked supply
523-
current_staked_supply: u64,
524-
//Genesis supply
525-
genesis_supply: u64,
526-
}
515+
epoch: u32;
516+
//Current time
517+
current_time: u64;
518+
//Number of blocks minted
519+
blocks_minted: u32;
520+
//WIT minted through block creation
521+
blocks_minted_reward: u64;
522+
//Current staked supply
523+
current_staked_supply: u64;
524+
//Genesis supply
525+
genesis_supply: u64;
526+
};
527527

528528
// Information about the total supply provided by the `getSupplyInfo2` sensitive method
529529
export type SupplyInfo2 = {

0 commit comments

Comments
 (0)