Skip to content
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

Fragment channel handler types into multiple small files #79

Merged

Conversation

richardkiss
Copy link

I did a small amount of group because the number of tiny structs was so overwhelming. I did it mostly by things similarly named, which is a tad naïve. Be open to moving things around a bit more, or fragmenting into smaller bits.

@richardkiss richardkiss requested a review from Copilot March 6, 2025 23:29
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.

PR Overview

This PR fragments the channel handler types into multiple smaller files to improve maintainability and organization. Key changes include the creation of separate files for validation info, evidence, unroll coin functionality, and other related types, as well as the removal of monolithic type definitions.

Reviewed Changes

File Description
src/channel_handler/types/validation_info.rs Separated and structured validation info logic
src/channel_handler/types/evidence.rs Introduced a dedicated Evidence struct with associated conversion functions
src/channel_handler/types/accept_transaction_state.rs Added enum for transaction state
src/channel_handler/types/validation_program.rs Isolated validation program functionality
src/channel_handler/types/coin_identification_by_puzzle_hash.rs Added coin identification types
src/channel_handler/types/readable_move.rs Created a separate file for handling readable moves
src/channel_handler/types/unroll_coin.rs Consolidated unroll coin logic and supporting helper functions
src/channel_handler/types/game_start_info.rs Organized game start info conversion from CLVM
src/channel_handler/types/channel_coin.rs Introduced channel coin spend information
src/channel_handler/types/coin_spent.rs Added types for coin spent information and outcomes
src/channel_handler/types/read.rs Added functions for reading unroll puzzles
src/channel_handler/types/on_chain_game_coin.rs Isolated on-chain game coin data
src/channel_handler/types/on_chain_game_state.rs Added on-chain game state structure
src/channel_handler/types/channel_handler.rs Created channel handler environment and key management functions
src/channel_handler/types/potato.rs Fragmented potato signature types for clarity
src/channel_handler/types/live_game.rs Added live game state management functionality
src/channel_handler/types/result.rs Introduced result types for moves and handshake outcomes
src/channel_handler/types/coin_data_for_reward.rs Created structure for holding coin reward data
src/channel_handler/types/mod.rs Re-exported and consolidated all newly created types across files

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/channel_handler/types/unroll_coin.rs:89

  • [nitpick] The error message 'no default setup' is vague and may not provide enough context for debugging. Consider using a more descriptive error message that specifies which default setup is missing.
Err(Error::StrErr("no default setup".to_string()))

@richardkiss richardkiss force-pushed the channel_handler_types branch from 7d71243 to cdc9d99 Compare March 7, 2025 01:09
@prozacchiwawa prozacchiwawa merged commit 4d430c2 into Chia-Network:active Mar 7, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants