This repository has been archived by the owner on Feb 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from etclabscore/feat/gasprice-monitoring
feat: add gas price average min max
- Loading branch information
Showing
28 changed files
with
5,724 additions
and
5,909 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
10.15.3 | ||
12.18.4 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.