Skip to content

Conversation

PatrickDinh
Copy link
Collaborator

@PatrickDinh PatrickDinh commented Aug 22, 2025

Proposed Changes

  • Replace utils CommonTransactionParams with macro

@PatrickDinh PatrickDinh changed the title Refactor to make it more rusty Replace utils CommonTransactionParams with macro Sep 4, 2025
@PatrickDinh PatrickDinh marked this pull request as ready for review September 4, 2025 05:22
@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 05:22
@PatrickDinh PatrickDinh requested a review from a team as a code owner September 4, 2025 05:22
@PatrickDinh PatrickDinh requested review from joe-p and removed request for a team September 4, 2025 05:22
Copy link
Contributor

@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 replaces the CommonTransactionParams struct with a macro-based approach to generate transaction parameter structures. Instead of each transaction parameter struct containing a nested common_params field, the common transaction parameters are now included directly as individual fields in each struct.

Key changes:

  • Removes CommonTransactionParams struct and related imports
  • Introduces a create_transaction_params! macro to generate transaction parameter structures
  • Flattens parameter structures by moving common fields directly into each transaction parameter struct
  • Updates all transaction parameter usages throughout the codebase to access fields directly

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

File Description
crates/algokit_utils/src/transactions/common.rs Defines the create_transaction_params! macro and removes CommonTransactionParams struct
crates/algokit_utils/src/transactions/*.rs Updates all transaction parameter structs to use the macro and flatten common fields
crates/algokit_utils/src/transactions/composer.rs Refactors field access methods to work with flattened structures
Test files Updates all test code to use direct field access instead of common_params
Comments suppressed due to low confidence (2)

crates/algokit_utils/src/transactions/composer.rs:1

  • This line has been incorrectly modified. The original code set static_fee to expected_fee - 1, but now it's setting max_fee. This changes the test behavior from testing static fee limits to max fee limits.
use crate::{

crates/algokit_utils/src/transactions/app_call.rs:1

  • This line appears to be setting static_fee without the proper struct context. The surrounding code suggests this should be part of an AppCallParams struct initialization, but the struct field mappings may be incorrect.
use super::composer::ComposerError;

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

3 participants