From 3afbce7d82c5a02681fab5469c605afb9e724298 Mon Sep 17 00:00:00 2001 From: Mark Q Schwanda Date: Wed, 16 Mar 2022 17:47:45 -0400 Subject: [PATCH 1/2] move json files from public to src --- {public/config => src}/abi.json | 0 {public/config => src}/config.json | 0 src/redux/blockchain/blockchainActions.js | 16 ++-------------- 3 files changed, 2 insertions(+), 14 deletions(-) rename {public/config => src}/abi.json (100%) rename {public/config => src}/config.json (100%) diff --git a/public/config/abi.json b/src/abi.json similarity index 100% rename from public/config/abi.json rename to src/abi.json diff --git a/public/config/config.json b/src/config.json similarity index 100% rename from public/config/config.json rename to src/config.json diff --git a/src/redux/blockchain/blockchainActions.js b/src/redux/blockchain/blockchainActions.js index 11368c655..be6159c0d 100644 --- a/src/redux/blockchain/blockchainActions.js +++ b/src/redux/blockchain/blockchainActions.js @@ -1,6 +1,8 @@ // constants import Web3EthContract from "web3-eth-contract"; import Web3 from "web3"; +import abi from '../../abi' +import CONFIG from '../../config' // log import { fetchData } from "../data/dataActions"; @@ -34,20 +36,6 @@ const updateAccountRequest = (payload) => { export const connect = () => { return async (dispatch) => { dispatch(connectRequest()); - const abiResponse = await fetch("/config/abi.json", { - headers: { - "Content-Type": "application/json", - Accept: "application/json", - }, - }); - const abi = await abiResponse.json(); - const configResponse = await fetch("/config/config.json", { - headers: { - "Content-Type": "application/json", - Accept: "application/json", - }, - }); - const CONFIG = await configResponse.json(); const { ethereum } = window; const metamaskIsInstalled = ethereum && ethereum.isMetaMask; if (metamaskIsInstalled) { From 0a107f6c685e18cb94f6db26b2e5aa0d60de9247 Mon Sep 17 00:00:00 2001 From: Mark Q Schwanda Date: Wed, 16 Mar 2022 18:06:26 -0400 Subject: [PATCH 2/2] update code style to match hashlips (;) --- src/redux/blockchain/blockchainActions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/redux/blockchain/blockchainActions.js b/src/redux/blockchain/blockchainActions.js index be6159c0d..9acefaa7f 100644 --- a/src/redux/blockchain/blockchainActions.js +++ b/src/redux/blockchain/blockchainActions.js @@ -1,8 +1,8 @@ // constants import Web3EthContract from "web3-eth-contract"; import Web3 from "web3"; -import abi from '../../abi' -import CONFIG from '../../config' +import abi from '../../abi'; +import CONFIG from '../../config'; // log import { fetchData } from "../data/dataActions";