Skip to content

Commit

Permalink
Merge commit '42695d42e5f35854db3ac6b92fb3b856659359cf' into core-nod…
Browse files Browse the repository at this point in the history
…e/fix-make-validator-info
  • Loading branch information
gokhan-simsek-iota committed Dec 26, 2024
2 parents a5d3828 + 42695d4 commit 5f64749
Show file tree
Hide file tree
Showing 45 changed files with 1,794 additions and 1,391 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-eagles-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@iota/dapp-kit': patch
---

Sync typography styling in both dark and light themes
24 changes: 21 additions & 3 deletions .github/workflows/_move_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,31 @@ jobs:
# to Move code but not Rust code (If there are Rust changes, they
# will be run as part of a larger test suite).
move-test:
timeout-minutes: 10
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38
with:
tool: nextest
- name: Run move tests
run: |
cargo nextest run -p iota-framework-tests -- unit_tests::
run: >
cargo nextest run --profile ci -E
'package(iota-framework-tests)
or (package(iota-core) and test(quorum_driver::))
or package(iota-benchmark)
or test(move_tests::)'
move-simtest:
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38
with:
tool: nextest
- name: Run move tests
run: >
scripts/simtest/cargo-simtest simtest --profile ci -E
'package(iota-framework-tests)
or (package(iota-core) and test(quorum_driver::))
or package(iota-benchmark)
or test(move_tests::)'
10 changes: 8 additions & 2 deletions .github/workflows/apps_wallet_prod_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
steps:
- name: Checking out the repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags. Default: 1
fetch-depth: 0
# Whether to fetch tags, even if fetch-depth > 0.
fetch-tags: "true"
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Install Nodejs
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
Expand Down Expand Up @@ -61,8 +66,9 @@ jobs:
echo "No previous tag found. Skipping changelog generation."
echo "changelog=No previous tag found. Changelog generation skipped." >> $GITHUB_OUTPUT
else
echo "## Changelog" >> CHANGELOG.md
git log ${{ env.PREV_TAG }}..${{ env.CURRENT_TAG }} --pretty=format:"- %s in #%h" -- ./apps/wallet > CHANGELOG.md
echo "## Changelog" > CHANGELOG.md
git log ${{ env.PREV_TAG }}..${{ env.CURRENT_TAG }} --pretty=format:"- %s in #%h" -- ./apps/wallet >> CHANGELOG.md
cat CHANGELOG.md
fi
- name: Get version from tag
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ jobs:
external-tests:
uses: ./.github/workflows/_external_rust_tests.yml

move-tests:
uses: ./.github/workflows/_move_tests.yml

deny:
uses: ./.github/workflows/_cargo_deny.yml

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thanks for considering making a contribution to the IOTA network or its document

## Contribute to IOTA

See [IOTA Environment Setup](https://github.com/iotaledger/iota/blob/main/docs/content/guides/developer/getting-started/iota-environment.mdx) for approach to submitting code fixes and enhancements.
See [IOTA Environment Setup](https://github.com/iotaledger/iota/blob/main/docs/content/developer/getting-started/iota-environment.mdx) for approach to submitting code fixes and enhancements.

Found a bug or security vulnerability? Create a [GitHub issue](https://github.com/iotaledger/iota/issues/new/choose).

Expand Down
1 change: 1 addition & 0 deletions apps/core/src/constants/coins.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

export const COINS_QUERY_REFETCH_INTERVAL = 20_000;
export const COINS_QUERY_STALE_TIME = 20_000;
export const COIN_TYPE = '0x2::coin::Coin';
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
// SPDX-License-Identifier: Apache-2.0

import { useIotaClientQuery } from '@iota/dapp-kit';
import { PlaceholderTable, TableCard } from '~/components/ui';
import { Link, PlaceholderTable, TableCard } from '~/components/ui';
import { generateValidatorsTableColumns } from '~/lib/ui';
import { InfoBox, InfoBoxStyle, InfoBoxType, Panel, Title } from '@iota/apps-ui-kit';
import {
Button,
ButtonSize,
ButtonType,
InfoBox,
InfoBoxStyle,
InfoBoxType,
Panel,
Title,
} from '@iota/apps-ui-kit';
import { ErrorBoundary } from '../error-boundary/ErrorBoundary';
import { Warning } from '@iota/ui-icons';

Expand All @@ -19,6 +28,9 @@ type TopValidatorsCardProps = {
export function TopValidatorsCard({ limit, showIcon }: TopValidatorsCardProps): JSX.Element {
const { data, isPending, isSuccess, isError } = useIotaClientQuery('getLatestIotaSystemState');

const topActiveValidators =
data?.activeValidators.slice(0, limit || NUMBER_OF_VALIDATORS) ?? [];

const tableColumns = generateValidatorsTableColumns({
atRiskValidators: [],
validatorEvents: [],
Expand All @@ -42,26 +54,33 @@ export function TopValidatorsCard({ limit, showIcon }: TopValidatorsCardProps):

return (
<Panel>
<Title title="Top Validators" />

<div className="p-md">
{isPending && (
<PlaceholderTable
rowCount={limit || NUMBER_OF_VALIDATORS}
rowHeight="13px"
colHeadings={['Name', 'Address', 'Stake']}
/>
)}
<div className="relative">
<div className="absolute right-0 mr-4 mt-2">
<Link to="/validators">
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
text="View All"
/>
</Link>
</div>
<Title title="Top Validators" />

{isSuccess && (
<ErrorBoundary>
<TableCard
data={data.activeValidators}
columns={tableColumns}
viewAll="/validators"
<div className="p-md">
{isPending && (
<PlaceholderTable
rowCount={limit || NUMBER_OF_VALIDATORS}
rowHeight="13px"
colHeadings={['Name', 'Address', 'Stake']}
/>
</ErrorBoundary>
)}
)}

{isSuccess && (
<ErrorBoundary>
<TableCard data={topActiveValidators} columns={tableColumns} />
</ErrorBoundary>
)}
</div>
</div>
</Panel>
);
Expand Down
35 changes: 19 additions & 16 deletions apps/wallet-dashboard/app/(protected)/assets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use client';

import { Panel, Title, Chip, TitleSize } from '@iota/apps-ui-kit';
import { hasDisplayData, useGetOwnedObjects } from '@iota/core';
import { COIN_TYPE, hasDisplayData, useGetOwnedObjects } from '@iota/core';
import { useCurrentAccount } from '@iota/dapp-kit';
import { IotaObjectData } from '@iota/iota-sdk/client';
import { useState } from 'react';
Expand All @@ -31,25 +31,28 @@ export default function AssetsDashboardPage(): React.JSX.Element {
const account = useCurrentAccount();
const { data, isFetching, fetchNextPage, hasNextPage, refetch } = useGetOwnedObjects(
account?.address,
undefined,
{
MatchNone: [{ StructType: COIN_TYPE }],
},
OBJECTS_PER_REQ,
);

const assets: IotaObjectData[] = [];

for (const page of data?.pages || []) {
for (const asset of page.data) {
if (asset.data && asset.data.objectId) {
if (selectedCategory == AssetCategory.Visual) {
if (hasDisplayData(asset)) {
assets.push(asset.data);
}
} else if (selectedCategory == AssetCategory.Other) {
assets.push(asset.data);
}
const assets = (data?.pages || [])
.flatMap((page) => page.data)
.filter((asset) => {
if (!asset.data || !asset.data.objectId) {
return false;
}
}
}
if (selectedCategory === AssetCategory.Visual) {
return hasDisplayData(asset);
}
if (selectedCategory === AssetCategory.Other) {
return !hasDisplayData(asset);
}
return false;
})
.map((asset) => asset.data)
.filter((data): data is IotaObjectData => data !== null && data !== undefined);

function onAssetClick(asset: IotaObjectData) {
setSelectedAsset(asset);
Expand Down
8 changes: 8 additions & 0 deletions apps/wallet-dashboard/app/(protected)/migrations/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ import { STARDUST_BASIC_OUTPUT_TYPE, STARDUST_NFT_OUTPUT_TYPE, useFormatCoin } f
import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils';
import { StardustOutputMigrationStatus } from '@/lib/enums';
import { MigrationObjectsPanel, MigrationDialog } from '@/components';
import { useRouter } from 'next/navigation';

function MigrationDashboardPage(): JSX.Element {
const account = useCurrentAccount();
const address = account?.address || '';
const queryClient = useQueryClient();
const iotaClient = useIotaClient();
const router = useRouter();
const [isMigrationDialogOpen, setIsMigrationDialogOpen] = useState(false);
const [selectedStardustObjectsCategory, setSelectedStardustObjectsCategory] = useState<
StardustOutputMigrationStatus | undefined
Expand Down Expand Up @@ -139,6 +141,11 @@ function MigrationDashboardPage(): JSX.Element {
setSelectedStardustObjectsCategory(undefined);
}

function handleMigrationDialogClose() {
setIsMigrationDialogOpen(false);
router.push('/');
}

return (
<div className="flex h-full w-full flex-wrap items-center justify-center space-y-4">
<div
Expand All @@ -159,6 +166,7 @@ function MigrationDashboardPage(): JSX.Element {
selectedStardustObjectsCategory ===
StardustOutputMigrationStatus.TimeLocked
}
handleClose={handleMigrationDialogClose}
/>
)}
<Panel>
Expand Down
Loading

0 comments on commit 5f64749

Please sign in to comment.