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/victory from 31.0.22 to 33.1.4 #238

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 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
6c98511
chore(deps-dev): bump @types/victory from 31.0.22 to 33.1.4
dependabot-preview[bot] Nov 7, 2020
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
11,297 changes: 5,494 additions & 5,803 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
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-router-dom": "^5.1.1",
"@types/victory": "^31.0.19",
"react-scripts": "^3.2.0",
"@types/victory": "^33.1.4",
"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
28 changes: 19 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
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 (query: string | undefined) => {
if (query === undefined) { return; }
const q = query.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
3 changes: 2 additions & 1 deletion 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 {ObjectUAh7GW7V as Transaction} from "@etclabscore/ethereum-json-rpc";

export interface IProps {
transactions: any[];
transactions: Transaction[];
from: number;
to: number;
disableNext?: boolean;
Expand Down
3 changes: 1 addition & 2 deletions src/components/BlockCard/BlockCard.tsx
Original file line number Diff line number Diff line change
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
40 changes: 40 additions & 0 deletions src/components/BlockView/BlockGasPrice.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import * as React from "react";
import { hexToNumber } from "@etclabscore/eserialize";
import { useTranslation } from "react-i18next";
import {meanBy, minBy, maxBy} from "lodash";

import { TableCell, TableRow } from "@material-ui/core";

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

if (transactions.length === 0) {return <></>;}

return (
<>
<TableRow>
<TableCell>{t("Average Gas Price")}</TableCell>
<TableCell>
{ meanBy(transactions, (t: any) => BigInt(t.gasPrice)) }
</TableCell>
</TableRow>

<TableRow>
<TableCell>{t("Min Gas Price")}</TableCell>
<TableCell>
{ hexToNumber(minBy(transactions, (t: any) => BigInt(t.gasPrice)).gasPrice) }
</TableCell>
</TableRow>

<TableRow>
<TableCell>{t("Max Gas Price")}</TableCell>
<TableCell>
{ hexToNumber(maxBy(transactions, (t: any) => BigInt(t.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
2 changes: 1 addition & 1 deletion src/components/NetworkDropdown/NetworkDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const NetworkDropdown: React.FC<IProps> = (props) => {
return (
<>

<Tooltip title={t("Change Network")}>
<Tooltip title={t("Change Network") as string}>
<Button onClick={handleClick}>
{selectedNetwork && selectedNetwork.name}
</Button>
Expand Down
Loading