From 279279831dc1c945377f9256ba6776ddf37f01f7 Mon Sep 17 00:00:00 2001 From: samepant Date: Sun, 16 Jan 2022 17:58:55 -0500 Subject: [PATCH] comment fixes --- context/AppReducer.js | 8 -------- lib/displayHelpers.js | 23 +++++++++++++---------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/context/AppReducer.js b/context/AppReducer.js index 1ab3b61..0a1fbf3 100644 --- a/context/AppReducer.js +++ b/context/AppReducer.js @@ -1,11 +1,3 @@ -// NEXT_PUBLIC_NODE_ADDRESS=https://cosmoshub.validator.network:443 -// NEXT_PUBLIC_DENOM=uatom -// NEXT_PUBLIC_DISPLAY_DENOM=ATOM -// NEXT_PUBLIC_DISPLAY_DENOM_EXPONENT=6 -// NEXT_PUBLIC_GAS_PRICE=0.03uatom -// NEXT_PUBLIC_CHAIN_ID=cosmoshub-4 -// NEXT_PUBLIC_ADDRESS_PREFIX=cosmos - export const initialState = { chain: { nodeAddress: process.env.NEXT_PUBLIC_NODE_ADDRESS, diff --git a/lib/displayHelpers.js b/lib/displayHelpers.js index 1490c79..b4461ff 100644 --- a/lib/displayHelpers.js +++ b/lib/displayHelpers.js @@ -21,16 +21,19 @@ const abbreviateLongString = (longString) => { // NARROW NO-BREAK SPACE (U+202F) const thinSpace = "\u202F"; -// Takes a Coin (e.g. `{"amount": "1234", "denom": "uatom"}`) and converts it -// into a user-readable string. -// -// Also takes in a chainInfo object, defined in '../context/AppReducer' -// -// The chainInfo provided displayDenom/displayDenomExponent -// will be used if the denom matches the denom stored in the chainInfo object. -// -// A leading "u" is interpreted as µ (micro) and uxyz will be converted to XYZ -// for displaying. +/** + * Takes a Coin (e.g. `{"amount": "1234", "denom": "uatom"}`) and converts it into a user-readable string. + * + * The chainInfo provided displayDenom/displayDenomExponent + * will be used if the denom matches the denom stored in the chainInfo object. + * + * A leading "u" is interpreted as µ (micro) and uxyz will be converted to XYZ + * for displaying. + * + * @param {object} coin (e.g. `{"amount": "1234", "denom": "uatom"}`) + * @param {object} chainInfo Provides information about a chain (e.g. node, prefix, denomination), object structure defined in '../context/AppReducer'. + * @return {string} The abbreviated string. + */ const printableCoin = (coin, chainInfo) => { // null, undefined and this sort of things if (!coin) return "–";