From 6e4e428308e9ac47b60d5451f3a66241ef223928 Mon Sep 17 00:00:00 2001 From: Alex Freska Date: Wed, 11 Dec 2024 15:11:29 -0500 Subject: [PATCH] fix(renterd,hostd): contract showing empty renewed from to IDs --- .changeset/fresh-actors-deny.md | 5 +++++ .changeset/fresh-mice-sneeze.md | 5 +++++ apps/hostd-e2e/src/specs/contracts.spec.ts | 10 +++++++++- apps/hostd/contexts/contracts/columns.tsx | 2 ++ apps/hostd/contexts/contracts/dataset.ts | 4 ++-- apps/renterd-e2e/src/specs/contracts.spec.ts | 6 ++++++ apps/renterd/contexts/contracts/columns.tsx | 1 + apps/renterd/contexts/contracts/dataset.tsx | 2 +- 8 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .changeset/fresh-actors-deny.md create mode 100644 .changeset/fresh-mice-sneeze.md diff --git a/.changeset/fresh-actors-deny.md b/.changeset/fresh-actors-deny.md new file mode 100644 index 000000000..3aa235f80 --- /dev/null +++ b/.changeset/fresh-actors-deny.md @@ -0,0 +1,5 @@ +--- +'hostd': patch +--- + +Contracts that have not been renewed from or two another contract no longer show the empty contract ID in the contract ID table cell. Closes https://github.com/SiaFoundation/hostd/issues/524 diff --git a/.changeset/fresh-mice-sneeze.md b/.changeset/fresh-mice-sneeze.md new file mode 100644 index 000000000..4e05b4e5d --- /dev/null +++ b/.changeset/fresh-mice-sneeze.md @@ -0,0 +1,5 @@ +--- +'renterd': patch +--- + +Contracts that have not been renewed from another contract no longer show the empty contract ID in the contract ID table cell. diff --git a/apps/hostd-e2e/src/specs/contracts.spec.ts b/apps/hostd-e2e/src/specs/contracts.spec.ts index 414c69ec6..6e79fa3ef 100644 --- a/apps/hostd-e2e/src/specs/contracts.spec.ts +++ b/apps/hostd-e2e/src/specs/contracts.spec.ts @@ -1,7 +1,7 @@ import { test, expect } from '@playwright/test' import { navigateToContracts } from '../fixtures/navigate' import { afterTest, beforeTest } from '../fixtures/beforeTest' -import { getContractRowsAll } from '../fixtures/contracts' +import { getContractRows, getContractRowsAll } from '../fixtures/contracts' test.beforeEach(async ({ page }) => { await beforeTest(page, { @@ -27,3 +27,11 @@ test('contracts bulk integrity check', async ({ page }) => { page.getByText('Integrity checks started for 2 contracts') ).toBeVisible() }) + +test('new contracts do not show a renewed from or to contract', async ({ + page, +}) => { + await navigateToContracts(page) + await expect(getContractRows(page).getByTestId('renewedFrom')).toBeHidden() + await expect(getContractRows(page).getByTestId('renewedTo')).toBeHidden() +}) diff --git a/apps/hostd/contexts/contracts/columns.tsx b/apps/hostd/contexts/contracts/columns.tsx index b7192883e..d7ddf91d6 100644 --- a/apps/hostd/contexts/contracts/columns.tsx +++ b/apps/hostd/contexts/contracts/columns.tsx @@ -79,6 +79,7 @@ export const columns: ContractsTableColumn[] = ( { await dialog.getByLabel('view allowlist').click() await expect(dialog.getByText('The allowlist is empty')).toBeVisible() }) + +test('new contracts do not show a renewed from', async ({ page }) => { + await navigateToContracts({ page }) + await expect(getContractRows(page).getByTestId('renewedFrom')).toBeHidden() +}) diff --git a/apps/renterd/contexts/contracts/columns.tsx b/apps/renterd/contexts/contracts/columns.tsx index f683b3870..0e9d632ec 100644 --- a/apps/renterd/contexts/contracts/columns.tsx +++ b/apps/renterd/contexts/contracts/columns.tsx @@ -77,6 +77,7 @@ export const columns: ContractsTableColumn[] = [ { const isRenewed = c.renewedFrom !== - 'fcid:0000000000000000000000000000000000000000000000000000000000000000' + '0000000000000000000000000000000000000000000000000000000000000000' const startTime = blockHeightToTime(currentHeight, c.startHeight) const endHeight = c.windowStart const endTime = blockHeightToTime(currentHeight, endHeight)