From f7086c1f410a9d989984d0a9d3ca5b73ef5228c5 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Fri, 20 Nov 2020 19:59:51 -0800 Subject: [PATCH 1/2] linting --- src/components/admin-lte/index.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index be4437f..c32d03e 100644 --- a/src/components/admin-lte/index.js +++ b/src/components/admin-lte/index.js @@ -60,18 +60,18 @@ class AdminLTEPage extends React.Component { - + -
+
{!_this.state.inFetch && ( -
+

{siteConfig.balanceText}

@@ -81,9 +81,9 @@ class AdminLTEPage extends React.Component { USD: ${_this.state.usdBalance}
@@ -101,8 +101,8 @@ class AdminLTEPage extends React.Component { - -
+ +
{_this.renderNewViewItems(_this.props)}
@@ -125,6 +125,7 @@ class AdminLTEPage extends React.Component { _this.setState({ inFetch: true }) + const { mnemonic } = _this.props.walletInfo if (mnemonic && _this.props.bchWallet) { const bchWalletLib = _this.props.bchWallet @@ -136,7 +137,7 @@ class AdminLTEPage extends React.Component { let currentRate if (bchjs.restURL.includes('abc.fullstack')) { - currentRate = await bchjs.Price.getBchaUsd() * 100 + currentRate = (await bchjs.Price.getBchaUsd()) * 100 } else { // BCHN price. currentRate = (await bchjs.Price.getUsd()) * 100 @@ -362,7 +363,7 @@ class AdminLTEPage extends React.Component { return (
  • {/* Adding this childrens prevents console errors */} - + @@ -415,6 +416,7 @@ class AdminLTEPage extends React.Component { } } } + // Props prvided by redux AdminLTEPage.propTypes = { walletInfo: PropTypes.object.isRequired, // wallet info From bb29225376d016e60ce4b49e1d5e70b914ef2d87 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Fri, 20 Nov 2020 20:11:22 -0800 Subject: [PATCH 2/2] fix(fee): Allowing tx fee assigned with env var --- src/components/admin-lte/index.js | 22 +++++++++++----------- src/redux/createStore.js | 6 ++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index c32d03e..ea2ebc7 100644 --- a/src/components/admin-lte/index.js +++ b/src/components/admin-lte/index.js @@ -60,18 +60,18 @@ class AdminLTEPage extends React.Component { - + -
    +
    {!_this.state.inFetch && ( -
    +

    {siteConfig.balanceText}

    @@ -81,9 +81,9 @@ class AdminLTEPage extends React.Component { USD: ${_this.state.usdBalance}
    @@ -101,8 +101,8 @@ class AdminLTEPage extends React.Component { - -
    + +
    {_this.renderNewViewItems(_this.props)}
    @@ -363,7 +363,7 @@ class AdminLTEPage extends React.Component { return (
  • {/* Adding this childrens prevents console errors */} - + diff --git a/src/redux/createStore.js b/src/redux/createStore.js index c654e13..5d4b033 100644 --- a/src/redux/createStore.js +++ b/src/redux/createStore.js @@ -78,6 +78,12 @@ const instanceWallet = () => { if (restURL) { bchjsOptions.restURL = restURL } + + // Assign the tx fee based on environment variable + const FEE = process.env.FEE ? process.env.FEE : 1 + bchjsOptions.fee = FEE + console.log(`Using ${bchjsOptions.fee} sats per byte for tx fees.`) + const bchWalletLib = new BchWallet(localStorageInfo.mnemonic, bchjsOptions) // Update bchjs instances of minimal-slp-wallet libraries