diff --git a/backend/src/routes/livepeer.js b/backend/src/routes/livepeer.js index 902c214..23ff40d 100644 --- a/backend/src/routes/livepeer.js +++ b/backend/src/routes/livepeer.js @@ -249,8 +249,6 @@ const parseOrchestrator = async function (reqAddr) { // First get cached object for (var orch of orchestratorCache) { if (orch.addr == reqAddr) { - console.log("found cached obj"); - console.log(orch); wasCached = true; orchestratorObj = orch; break; @@ -259,9 +257,6 @@ const parseOrchestrator = async function (reqAddr) { if (wasCached) { if (now - orch.lastGet < timeoutTheGraph) { needsUpdate = false; - console.log("cached obj is up to date"); - }else{ - console.log("cached obj needs update"); } } if (!wasCached || needsUpdate) { @@ -306,23 +301,17 @@ const parseOrchestrator = async function (reqAddr) { } `; orchestratorObj = JSON.stringify(await request("https://api.thegraph.com/subgraphs/name/livepeer/arbitrum-one", orchQuery)); - console.log("downloaded new obj"); - console.log(orchestratorObj); if (wasCached) { for (var orch of orchestratorCache) { if (orch.addr == requestedOrchestrator) { - console.log("modifying existing obj in cache"); orch = orchestratorObj; break; } } } else { - console.log("pushing this obj to cache"); orchestratorCache.push(orchestratorObj); } } - console.log("returning obj"); - console.log(orchestratorObj); return orchestratorObj; } @@ -335,7 +324,6 @@ apiRouter.get("/getOrchestrator", async (req, res) => { const reqObj = await parseOrchestrator(reqOrch); res.send(reqObj); } catch (err) { - console.log(err); res.status(400).send(err); } }); @@ -345,7 +333,6 @@ apiRouter.get("/getOrchestrator/:orch", async (req, res) => { const reqObj = await parseOrchestrator(req.params.orch); res.send(reqObj); } catch (err) { - console.log(err); res.status(400).send(err); } }); diff --git a/src/actions/error.js b/src/actions/error.js index 9571eb4..48d6d41 100644 --- a/src/actions/error.js +++ b/src/actions/error.js @@ -1,9 +1,3 @@ -{/* Ability to receive and clear errors as dispatch actions -Requires this in files where errors can be received: -const mapStateToProps = ({ errors }) => ({ - errors -}); -*/} export const RECEIVE_ERRORS = "RECEIVE_ERRORS"; export const RECEIVE_NOTIFICATIONS = "RECEIVE_NOTIFICATIONS"; export const CLEAR_ERRORS = "CLEAR_ERRORS"; diff --git a/src/actions/livepeer.js b/src/actions/livepeer.js index b6c11ac..3627484 100644 --- a/src/actions/livepeer.js +++ b/src/actions/livepeer.js @@ -62,7 +62,6 @@ export const getCurrentOrchestratorInfo = () => async dispatch => { export const getOrchestratorInfo = (orchAddr) => async dispatch => { const response = await apiUtil.getOrchestratorInfo(orchAddr); const data = await response.json(); - console.log(data); if (response.ok) { return dispatch(setOrchestratorInfo(data)); } diff --git a/src/eventButton.js b/src/eventButton.js index 932569c..77dcb7a 100644 --- a/src/eventButton.js +++ b/src/eventButton.js @@ -9,9 +9,9 @@ const stakeColour = "rgba(71, 23, 122, 0.3)"; const EventButton = (obj) => { // Data shared among all events in this transaction const thisURL = obj.transactionUrl; - const thisTransaction = obj.transactionHash; + //const thisTransaction = obj.transactionHash; const thisData = obj.events; - const thisIndex = obj.idx; + //const thisIndex = obj.idx; // Abstraction of all events in this transaction let transactionName = ""; let transactionCaller = ""; @@ -28,7 +28,7 @@ const EventButton = (obj) => { // Which we will fill in by going over all of the events once thisData.map(eventObj => { // Bond: contains amount the transaction is about and who is participating - if (eventObj.name == "Bond") { + if (eventObj.name === "Bond") { transactionCaller = eventObj.data.delegator.toLowerCase(); transactionFrom = eventObj.data.oldDelegate.toLowerCase(); transactionTo = eventObj.data.newDelegate.toLowerCase(); @@ -37,7 +37,7 @@ const EventButton = (obj) => { hasBondTransaction = true; } // TranscoderActivated: defines transactionName. Defines transactionAmount as X * 7e-18 LPT - if (eventObj.name == "TranscoderActivated") { + if (eventObj.name === "TranscoderActivated") { transactionName = "Activated"; transactionWhen = eventObj.data.activationRound; if (!hasBondTransaction) { @@ -47,7 +47,7 @@ const EventButton = (obj) => { isOnlyBond = false; } // TranscoderActivated: defines transactionName. Defines transactionAmount as X / 1000000000000000000 LPT - if (eventObj.name == "Reward") { + if (eventObj.name === "Reward") { transactionName = "Reward"; transactionCaller = eventObj.data.transcoder.toLowerCase(); transactionAmount = eventObj.data.amount / 1000000000000000000; @@ -55,7 +55,7 @@ const EventButton = (obj) => { isOnlyBond = false; } // TranscoderUpdate: defines transactionName. Defines transactionAmount as rewardCut and transactionAdditionalAmount as feeCut - if (eventObj.name == "TranscoderUpdate") { + if (eventObj.name === "TranscoderUpdate") { transactionName = "Update"; transactionCaller = eventObj.data.transcoder.toLowerCase(); transactionAmount = eventObj.data.rewardCut / 10000; @@ -64,7 +64,7 @@ const EventButton = (obj) => { isOnlyBond = false; } // WithdrawStake: defines transactionName. Defines transactionAmount as rewardCut and transactionAdditionalAmount as feeCut - if (eventObj.name == "WithdrawStake") { + if (eventObj.name === "WithdrawStake") { transactionName = "Withdraw"; transactionCaller = eventObj.data.delegator.toLowerCase(); transactionAmount = eventObj.data.amount / 1000000000000000000; @@ -81,7 +81,7 @@ const EventButton = (obj) => { } let eventSpecificInfo; - if (transactionName == "Reward") { + if (transactionName === "Reward") { if (transactionAmount - 69 < 1 && transactionAmount - 69 > 0) { eventSpecificInfo =
@@ -93,12 +93,12 @@ const EventButton = (obj) => {

called reward worth {transactionAmount.toFixed(2)} LPT

} - } else if (transactionName == "Update") { + } else if (transactionName === "Update") { eventSpecificInfo =

changed their reward commission to {transactionAmount.toFixed(2)}% and their fee commission to {transactionAdditionalAmount.toFixed(2)}%

- } else if (transactionName == "Stake") { + } else if (transactionName === "Stake") { if (transactionFrom == "0x0000000000000000000000000000000000000000") { eventSpecificInfo =
@@ -114,12 +114,12 @@ const EventButton = (obj) => {
} - } else if (transactionName == "Withdraw") { + } else if (transactionName === "Withdraw") { eventSpecificInfo =

withdrew {(transactionAmount / 1000000000000000000).toFixed(2)} LPT in round {transactionWhen}

- } else if (transactionName == "Activated") { + } else if (transactionName === "Activated") { if (hasBondTransaction) { eventSpecificInfo =
diff --git a/src/eventViewer.js b/src/eventViewer.js index 13d5424..9d2bf9f 100644 --- a/src/eventViewer.js +++ b/src/eventViewer.js @@ -20,8 +20,8 @@ const EventViewer = (obj) => {
{obj.events.slice(0).reverse().map((eventObj, idx) => { // Filter - if (eventObj.name == "WithdrawFees" || eventObj.name == "TransferBond" - || eventObj.name == "Rebond" || eventObj.name == "Unbond" || eventObj.name == "EarningsClaimed"){ + if (eventObj.name === "WithdrawFees" || eventObj.name === "TransferBond" + || eventObj.name === "Rebond" || eventObj.name === "Unbond" || eventObj.name === "EarningsClaimed"){ return; } // New transaction found diff --git a/src/orchestratorViewer.js b/src/orchestratorViewer.js index 61a446d..6a418dd 100644 --- a/src/orchestratorViewer.js +++ b/src/orchestratorViewer.js @@ -47,26 +47,20 @@ const Orchestrator = (obj) => { {thisID}
-
-

Earned fees {totalVolumeETH} Eth (${totalVolumeUSD})

-
-
-

Reward Cut {rewardCut}%

-

Fee Cut {feeCut}%

-
-
-

Total Stake {totalStake} LPT

-

Self stake {selfStake} LPT ({selfStakeRatio}%)

-
+

Earned fees {totalVolumeETH} Eth (${totalVolumeUSD})

+

Reward Cut {rewardCut}%

+

Fee Cut {feeCut}%

+

Total Stake {totalStake} LPT

+

Self stake {selfStake} LPT ({selfStakeRatio}%)

-
+
{ delegators.map((delObj, idx) => { return ( -
+
{delObj.id.substr(0, 6) + ".."}
@@ -85,14 +79,12 @@ const Orchestrator = (obj) => { } return (
-
-
- -

Orchestrator Info

-
-
-

Click on an orchestrator in the list below!

-
+
+ +

Orchestrator Info

+
+
+

Click on an orchestrator in the list below!

) diff --git a/src/style.css b/src/style.css index 5abacf0..529819c 100644 --- a/src/style.css +++ b/src/style.css @@ -59,7 +59,6 @@ p { /* width */ ::-webkit-scrollbar { width: 10px; - box-shadow: 0px 0px 8px 4px rgba(8, 7, 56, 0.692); border-radius: 10px; }