Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

chore(deps-dev): bump @types/react-dom from 16.9.8 to 17.0.1 #507

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5364e79
feat: add gas price average min max
BelfordZ Feb 20, 2020
ece1d4c
fix: linting
BelfordZ Oct 14, 2020
2ed5dc6
fix: update node version and typescript
BelfordZ Oct 14, 2020
3e96c9d
fix: got most things working
BelfordZ Oct 14, 2020
858fc81
fix: blockcard fixed
BelfordZ Oct 14, 2020
2d1d825
fix: wip fixing typescript issues
BelfordZ Oct 14, 2020
1943004
fix: small refactoring and typescript error fixing
BelfordZ Oct 16, 2020
96869e3
fix: as any into as string
BelfordZ Oct 16, 2020
d1e784a
fix: more changing of any to string
BelfordZ Oct 16, 2020
f471957
fix: uncomment feature
BelfordZ Oct 16, 2020
4d6324d
fix: use isNaN instead of str8 checking
BelfordZ Oct 16, 2020
0411680
fix: import only required from lodash
BelfordZ Oct 16, 2020
97b3f1e
fix: formatting issues
BelfordZ Oct 16, 2020
28ec7fc
fix: completed rebase from hell
BelfordZ Oct 16, 2020
7defb8d
fix: regenerate packagelock
BelfordZ Oct 16, 2020
fca52bd
fix: missed one error in rebase
BelfordZ Oct 16, 2020
d7b3841
fix: add radix to parse int
BelfordZ Oct 17, 2020
bfa2bdc
fix: update service runner core-geth
shanejonas Oct 21, 2020
6858b94
Merge pull request #424 from etclabscore/fix/update-service-runner-co…
shanejonas Oct 21, 2020
1c346b8
fix(editorconfig): set pulltagsbranch to empty string
shanejonas Oct 21, 2020
fd2fd4a
Merge pull request #426 from etclabscore/fix/semantic-release-pulltag…
shanejonas Oct 21, 2020
474ad9c
fix: update coregeth to 1.11.16
shanejonas Oct 23, 2020
0c15dad
Merge pull request #429 from etclabscore/fix/update-coregeth-1-11-16
shanejonas Oct 23, 2020
1ec523e
Merge pull request #257 from etclabscore/feat/gasprice-monitoring
shanejonas Nov 7, 2020
56a67e7
fix: update service runner client + eth client + core-geth
shanejonas Nov 7, 2020
27d6f76
Merge pull request #438 from etclabscore/fix/update-service-runner
shanejonas Nov 7, 2020
2070fe1
fix: handle bigint with maxBy and minBy
shanejonas Nov 9, 2020
269d06e
Merge pull request #441 from etclabscore/fix/minby-maxby
shanejonas Nov 9, 2020
c2b14b5
chore(deps-dev): bump @types/react-dom from 16.9.8 to 17.0.1
dependabot-preview[bot] Feb 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ aliases:

defaults: &defaults
working_directory: ~/project
docker:
- image: circleci/node:12

jobs:
test:
<<: *defaults
docker:
- image: circleci/node:10
steps:
- checkout
- restore_cache: *restore-deps-cache
Expand All @@ -41,8 +41,6 @@ jobs:

build:
<<: *defaults
docker:
- image: circleci/node:10
steps:
- checkout
- restore_cache: *restore-deps-cache
Expand All @@ -52,8 +50,6 @@ jobs:

release:
<<: *defaults
docker:
- image: circleci/node:10
steps:
- checkout
- restore_cache: *restore-deps-cache
Expand Down
23 changes: 23 additions & 0 deletions .jsbeautifyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"indent_size": 2,
"indent_char": " ",
"eol": "\n",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": true,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 80,
"wrap_attributes": "auto",
"wrap_attributes_indent_size": 2,
"e4x": true,
"end_with_newline": true
}
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.15.3
12.18.4
3 changes: 2 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"path": "@qiwi/semantic-release-gh-pages-plugin",
"msg": "github pages release",
"src": "build/",
"branch": "gh-pages"
"branch": "gh-pages",
"pullTagsBranch": ""
},
{
"path": "semantic-release-docker",
Expand Down
13,650 changes: 6,732 additions & 6,918 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
},
"dependencies": {
"@etclabscore/eserialize": "^1.0.2",
"@etclabscore/ethereum-json-rpc": "1.2.2",
"@etclabscore/ethereum-json-rpc": "^1.3.13",
"@etclabscore/ethereum-json-rpc-specification": "git+https://github.com/etclabscore/ethereum-json-rpc-specification.git",
"@etclabscore/jade-service-runner-client": "^1.9.0",
"@etclabscore/jade-service-runner-client": "^1.10.5",
"@material-ui/core": "^4.5.2",
"@material-ui/icons": "^4.5.1",
"@material-ui/styles": "^4.5.2",
Expand Down Expand Up @@ -66,17 +66,17 @@
"@types/bignumber.js": "^4.0.3",
"@types/jest": "^21.1.6",
"@types/lodash": "^4.14.149",
"@types/node": "^8.10.58",
"@types/node": "^14.11.8",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.3",
"@types/react-dom": "^17.0.1",
"@types/react-router-dom": "^5.1.1",
"@types/victory": "^31.0.19",
"react-scripts": "^3.2.0",
"react-scripts": "^3.4.3",
"ts-jest": "^24.1.0",
"ts-node": "^8.5.0",
"tslint": "^5.8.0",
"tslint-react": "^4.1.0",
"typescript": "^3.7.2"
"typescript": "^3.9.7"
},
"browserslist": {
"production": [
Expand Down
30 changes: 20 additions & 10 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Brightness3Icon from "@material-ui/icons/Brightness3";
import NotesIcon from "@material-ui/icons/Notes";
import WbSunnyIcon from "@material-ui/icons/WbSunny";
import CodeIcon from "@material-ui/icons/Code";
import ServiceRunner, { ObjectT84Ta8SE as IAvailableServices } from "@etclabscore/jade-service-runner-client";
import ServiceRunner, { ObjectOfStringDoaGddGAStringVp8AIgHFStringDoaGddGAUnorderedSetOfObjectOfStringDoaGddGAStringDoaGddGAKieCSt44UIuKSje3YY1BLmC3 as IAvailableServices } from "@etclabscore/jade-service-runner-client"; //tslint:disable-line
import availableServiceToNetwork from "./helpers/availableServiceToNetwork";

import useInterval from "use-interval";
Expand Down Expand Up @@ -86,11 +86,16 @@ function App(props: any) {
}, [networks, query.network]);

useEffect(() => {
if (selectedNetwork && selectedNetwork.name !== query.network) {
setQuery({ network: selectedNetwork.name });
if (selectedNetwork === undefined) {
return;
}
const { name } = selectedNetwork as any;

if (name !== query.network) {
setQuery({ network: name });
history.push({
pathname: history.location.pathname,
search: `?network=${selectedNetwork.name}`,
search: `?network=${name}`,
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -132,7 +137,9 @@ function App(props: any) {
return re.test(q);
};

const handleSearch = async (q: string) => {
const handleSearch = async (qry: string | undefined) => {
if (qry === undefined) { return; }
const q = qry.trim();
if (isAddress(q)) {
history.push(`/address/${q}`);
}
Expand Down Expand Up @@ -202,13 +209,16 @@ function App(props: any) {
onKeyDown={
(event: KeyboardEvent<HTMLInputElement>) => {
if (event.keyCode === 13) {
handleSearch(search.trim());
handleSearch(search);
}
}
}
onChange={
(event: ChangeEvent<HTMLInputElement>) => {
setSearch(event.target.value);
if (event.target.value) {
const {value} = event.target;
setSearch(value as any);
}
}
}
fullWidth
Expand All @@ -227,15 +237,15 @@ function App(props: any) {
selectedNetwork={selectedNetwork}
/>
<LanguageMenu />
<Tooltip title={t("JSON-RPC API Documentation")}>
<Tooltip title={t("JSON-RPC API Documentation") as string}>
<IconButton
onClick={() =>
window.open("https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/etclabscore/ethereum-json-rpc-specification/master/openrpc.json") //tslint:disable-line
}>
<NotesIcon />
</IconButton>
</Tooltip>
<Tooltip title={t("Expedition Github")}>
<Tooltip title={t("Expedition Github") as string}>
<IconButton
onClick={() =>
window.open("https://github.com/etclabscore/expedition")
Expand All @@ -244,7 +254,7 @@ function App(props: any) {
</IconButton>
</Tooltip>
<ConfigurationMenu onChange={handleConfigurationChange} />
<Tooltip title={t("Toggle Dark Mode")}>
<Tooltip title={t("Toggle Dark Mode") as string}>
<IconButton onClick={darkMode.toggle}>
{darkMode.value ? <Brightness3Icon /> : <WbSunnyIcon />}
</IconButton>
Expand Down
5 changes: 3 additions & 2 deletions src/components/AddressTransactions/AddressTransactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { Typography, IconButton, Grid } from "@material-ui/core";
import { useTranslation } from "react-i18next";
import TxList from "../TxList";
import { ArrowBackIos, ArrowForwardIos } from "@material-ui/icons";
import { Transaction } from "@etclabscore/ethereum-json-rpc";

export interface IProps {
transactions: any[];
transactions: Transaction[];
from: number;
to: number;
disableNext?: boolean;
Expand All @@ -32,7 +33,7 @@ const AddressTransactions: React.FC<IProps> = (props) => {
</Grid>
<TxList transactions={props.transactions || []} showBlockNumber={true}></TxList>
{(!props.transactions || props.transactions.length === 0) &&
<Grid container style={{padding: "15px"}}>
<Grid container style={{ padding: "15px" }}>
<Typography>{t("No Transactions for this block range.")}</Typography>
</Grid>
}
Expand Down
5 changes: 2 additions & 3 deletions src/components/BlockCard/BlockCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from "@material-ui/core/Link";
import { Link as RouterLink } from "react-router-dom";
import { Card, CardHeader, CardContent, Typography, Chip } from "@material-ui/core";
import { hexToDate, hexToString, hexToNumber } from "@etclabscore/eserialize";
import { GetBlockByNumberResult as IBlock } from "@etclabscore/ethereum-json-rpc";
import { Block as IBlock } from "@etclabscore/ethereum-json-rpc";
import { useTranslation } from "react-i18next";

interface IProps {
Expand Down Expand Up @@ -32,8 +32,7 @@ export default function BlockCard(props: IProps) {
<Typography variant="caption" style={{ fontSize: "11px" }}>{block.hash}</Typography>
<Typography gutterBottom>{t("Timestamp Date", { date: hexToDate(block.timestamp!) })}</Typography>
<Typography gutterBottom>{hexToString(block.extraData!)}</Typography>
<Chip label={`${block.transactions!.length} Transactions`}>
</Chip>
<Chip label={`${block.transactions!.length} Transactions`} />
</CardContent>
</Card>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion src/components/BlockList/BlockList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function BlockList({ blocks }: any) {
<Typography>{t("Timestamp Date", { date: hexToDate(b.timestamp) })}&nbsp;<sub>({timeDifferenceFromParent > 0 ? `+${timeDifferenceFromParent}` : `-${timeDifferenceFromParent}`}s)</sub></Typography>
</TableCell>
<TableCell style={rightPaddingFix}>
<Tooltip title={t("Create Transactions", {count: txTypes.create})} placement="top">
<Tooltip title={t("Create Transactions", {count: txTypes.create}) as string} placement="top">
<Typography variant="caption" color="textSecondary">{txTypes.create === 0 ? "" : txTypes.create}</Typography>
</Tooltip>
<Typography>{txTypes.transact}</Typography>
Expand Down
61 changes: 61 additions & 0 deletions src/components/BlockView/BlockGasPrice.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import * as React from "react";
import { hexToNumber } from "@etclabscore/eserialize";
import { useTranslation } from "react-i18next";
import { TableCell, TableRow } from "@material-ui/core";

const BigIntMinBy = (list: [], func: (item: any) => BigInt): any => {
let min: any;
for (const item of list) {
if (min === undefined) {
min = item;
continue;
}
const r = func(item);
if (r < func(min)) {
min = item;
}
}
return min;
};

const BigIntMaxBy = (list: [], func: (item: any) => BigInt): any => {
let max: any;
for (const item of list) {
if (max === undefined) {
max = item;
continue;
}
const r = func(item);
if (r > func(max)) {
max = item;
}
}
return max;
};

function BlockGasPrice(props: any) {
const { t } = useTranslation();
const { transactions } = props.block;

if (transactions.length === 0) { return null; }

return (
<>
<TableRow>
<TableCell>{t("Min Gas Price")}</TableCell>
<TableCell>
{hexToNumber(BigIntMinBy(transactions, (tx: any) => BigInt(tx.gasPrice))?.gasPrice || "")}
</TableCell>
</TableRow>

<TableRow>
<TableCell>{t("Max Gas Price")}</TableCell>
<TableCell>
{hexToNumber(BigIntMaxBy(transactions, (tx: any) => BigInt(tx.gasPrice))?.gasPrice) || ""}
</TableCell>
</TableRow>
</>
);
}

export default BlockGasPrice;
35 changes: 21 additions & 14 deletions src/components/BlockView/BlockView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { useHistory } from "react-router-dom";

import { Table, TableBody, TableCell, TableRow, Button, LinearProgress, Typography } from "@material-ui/core";

import BlockGasPrice from "./BlockGasPrice";

function BlockView(props: any) {
const { block } = props;
const history = useHistory();
Expand All @@ -28,11 +30,11 @@ function BlockView(props: any) {
return (
<div>
<Button
onClick={() => {
history.push(`/block/${block.hash}/raw`);
}}
onClick={() => { history.push(`/block/${block.hash}/raw`); }}
style={{ position: "absolute", right: "10px", top: "75px" }}
>View Raw</Button>
>
View Raw
</Button>
<Table>
<TableBody>
<TableRow>
Expand All @@ -43,14 +45,22 @@ function BlockView(props: any) {
<TableRow>
<TableCell>{t("Gas Usage")}</TableCell>
<TableCell>
<Typography variant="caption">{hexToNumber(gasUsed)}/{hexToNumber(gasLimit)}</Typography>
<LinearProgress style={{width: "150px"}} value={filledPercent} variant="determinate" />
<Typography variant="caption">
{hexToNumber(gasUsed)}/{hexToNumber(gasLimit)}
</Typography>
<LinearProgress
style={{width: "150px"}}
value={filledPercent}
variant="determinate"
/>
</TableCell>
</TableRow>

<TableRow>
<TableCell>{t("Timestamp")}</TableCell>
<TableCell>{t("Timestamp Date", { date: hexToDate(timestamp) })}</TableCell>
<TableCell>
{t("Timestamp Date", { date: hexToDate(timestamp) })}
</TableCell>
</TableRow>

<TableRow>
Expand All @@ -63,7 +73,7 @@ function BlockView(props: any) {
<TableCell>
<Link
component={({ className, children }: { children: any, className: string }) => (
<RouterLink className={className} to={`/block/${parentHash}`} >
<RouterLink className={className} to={`/block/${parentHash}`}>
{children}
</RouterLink>
)}>
Expand All @@ -77,7 +87,7 @@ function BlockView(props: any) {
<TableCell>
<Link
component={({ className, children }: { children: any, className: string }) => (
<RouterLink className={className} to={`/address/${miner}`} >
<RouterLink className={className} to={`/address/${miner}`}>
{children}
</RouterLink>
)}>
Expand All @@ -86,10 +96,7 @@ function BlockView(props: any) {
</TableCell>
</TableRow>

<TableRow>
<TableCell>{t("Gas Used")}</TableCell>
<TableCell>{hexToNumber(gasUsed)}</TableCell>
</TableRow>
<BlockGasPrice block={block} />

<TableRow>
<TableCell>{t("Gas Limit")}</TableCell>
Expand Down Expand Up @@ -134,7 +141,7 @@ function BlockView(props: any) {
</Table>

<TxList transactions={transactions} />
</ div >
</div>
);
}

Expand Down
Loading