Skip to content

Commit

Permalink
hide nonce field in the block views
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Aug 24, 2023
1 parent 2df78df commit 0ec2e10
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions configs/app/ui/views/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { getEnvValue, parseEnvJson } from 'configs/app/utils';
export const BLOCK_FIELDS_IDS = [
'burnt_fees',
'total_reward',
'nonce',
] as const;

export type BlockFieldId = ArrayElement<typeof BLOCK_FIELDS_IDS>;
Expand Down
1 change: 1 addition & 0 deletions docs/ENVS.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ The app version shown in the footer is derived from build-time ENV variables `NE
| --- | --- |
| `burnt_fees` | Burnt fees |
| `total_reward` | Total block reward |
| `nonce` | Block nonce |

&nbsp;

Expand Down
2 changes: 1 addition & 1 deletion playwright/utils/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const featureEnvs = {
export const viewsEnvs = {
block: {
hiddenFields: [
{ name: 'NEXT_PUBLIC_VIEWS_BLOCK_HIDDEN_FIELDS', value: '["burnt_fees", "total_reward"]' },
{ name: 'NEXT_PUBLIC_VIEWS_BLOCK_HIDDEN_FIELDS', value: '["burnt_fees", "total_reward", "nonce"]' },
],
},
};
2 changes: 1 addition & 1 deletion ui/block/BlockDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ const BlockDetails = ({ query }: Props) => {
>
<Text wordBreak="break-all" whiteSpace="break-spaces">{ data.state_root }</Text>
</DetailsInfoItem> */ }
{ config.chain.verificationType !== 'validation' && (
{ config.chain.verificationType !== 'validation' && !config.UI.views.block.hiddenFields?.nonce && (
<DetailsInfoItem
title="Nonce"
hint="Block nonce is a value used during mining to demonstrate proof of work for a block"
Expand Down

0 comments on commit 0ec2e10

Please sign in to comment.