Skip to content

fix(apps): align txn types #1138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: fix_renterd-e2e_flaky_wallet_tests
Choose a base branch
from

Conversation

alexfreska
Copy link
Member

@alexfreska alexfreska commented Jun 26, 2025

  • Transaction and contract and contract resolution types and labels are now fully aligned across all apps.

Changes

  • Added support for the contract refresh event type. Contract Renewals are not showing label hostd#759
  • Transaction headers in the explorer now show a badge with the specific type.
  • Fixed an issue with the ContractResolution type.
  • Fixed v1 ExplorerTransaction arbitraryData type.
  • Added support for the arbitrary data event type.

renterd / hostd / walletd

Screenshot 2025-06-26 at 2.44.22 PM.png

explorer

Screenshot 2025-06-26 at 3.44.47 PM.png

Screenshot 2025-06-26 at 3.44.59 PM.png

Copy link

vercel bot commented Jun 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 6:49pm
explorer-zen ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 6:49pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
hostd ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2025 6:49pm
renterd ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2025 6:49pm

@Copilot Copilot AI review requested due to automatic review settings June 26, 2025 20:00
Copy link

changeset-bot bot commented Jun 26, 2025

🦋 Changeset detected

Latest commit: f817712

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@siafoundation/types Minor
@siafoundation/units Minor
explorer Minor
hostd Minor
renterd Minor
walletd Minor
@siafoundation/explored-types Patch
@siafoundation/clusterd Patch
@siafoundation/design-system Patch
@siafoundation/hostd-types Patch
@siafoundation/react-core Major
@siafoundation/renterd-types Patch
@siafoundation/sdk Patch
@siafoundation/walletd-mock Patch
@siafoundation/walletd-types Patch
@siafoundation/hostd-react Patch
@siafoundation/renterd-react Patch
@siafoundation/walletd-react Patch
@siafoundation/e2e Patch
@siafoundation/explored-js Patch
@siafoundation/explored-react Patch
@siafoundation/hostd-js Patch
@siafoundation/sia-central-react Patch
@siafoundation/renterd-js Patch
@siafoundation/walletd-js Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation bot moved this to In Progress in Sia Jun 26, 2025
Copy link
Member Author

alexfreska commented Jun 26, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR standardizes contract resolution types across V1 and V2 transactions, introduces a new contractRefresh case when a renewal doesn’t change the contract, and updates related type definitions and explorer components to use the new patterns.

  • Refactor and split getTransactionType into getV1TransactionType and getV2TransactionType, adding contractRefresh logic.
  • Rename resolution kinds from "storage proof" to "storageProof" and adjust type definitions in @siafoundation/types.
  • Update Transaction.arbitraryData shapes and propagate changes into explorer converters and components.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
libs/units/src/transactionTypes.ts Introduced getV1TransactionType/getV2TransactionType, added contractRefresh, updated mappings
libs/types/src/v2.ts Renamed and consolidated V2FileContractResolution types, standardized storageProof naming
libs/types/src/core.ts Changed Transaction.arbitraryData from string[] to string[][]
libs/explored-types/src/types.ts Adjusted ExplorerTransaction.arbitraryData from string[][] to string[]
apps/explorer/lib/tx.ts Added helper to convert ExplorerV2Transaction into parameters for getV2TransactionType
apps/explorer/components/Transaction/index.tsx Swapped title prop for txType on Transaction component
apps/explorer/components/Transaction/TransactionHeader.tsx Added a badge showing txType and updated header layout
apps/explorer/components/Entity/EntityListItem.tsx Replaced getTransactionType with getV1TransactionType and new V2 conversion helper
apps/explorer/components/ContractView/index.tsx Pass txType instead of hardcoded title for formation transactions
apps/explorer/app/(main)/tx/[id]/page.tsx Imported and used getV1TransactionType/getV2TransactionType to set txType prop
.changeset/quick-avocados-accept.md Documented a patch for @siafoundation/types fixing resolution types
.changeset/old-gorillas-shout.md Announced support for the new contractRefresh event
Comments suppressed due to low confidence (2)

libs/units/src/transactionTypes.ts:118

  • [nitpick] The new contractRefresh path in getV2TransactionType should have dedicated unit tests for both equal and non-equal height scenarios to prevent regressions.
        : 'contractRenewal'

libs/types/src/core.ts:152

  • Changing arbitraryData from string[] to string[][] is a breaking change; ensure all consumers (including V1 handlers) are updated to handle the new shape.
  arbitraryData?: string[][]

@alexfreska alexfreska changed the base branch from main to graphite-base/1138 June 27, 2025 18:44
@alexfreska alexfreska force-pushed the fix_apps_align_contract_resolution_types branch from 062d9ce to f817712 Compare June 27, 2025 18:44
@alexfreska alexfreska changed the base branch from graphite-base/1138 to fix_renterd-e2e_flaky_wallet_tests June 27, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants