Skip to content

Conversation

@scarmuega
Copy link
Member

@scarmuega scarmuega commented Dec 23, 2025

Summary by CodeRabbit

  • Removed Features

    • Removed the interactive transaction construction wizard and all related build tools.
  • Updates

    • Refactored transaction invocation and resolution workflows for enhanced protocol support.
    • Renamed transaction command-line arguments for improved consistency.
    • Modernized wallet address encoding with updated cryptographic libraries.
  • Chores

    • Updated and restructured project dependencies.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR removes TX3 transaction construction features and refactors transaction invocation to use TII (Transaction Invocation Interface). Dependencies are updated: bech32 upgraded, tx3-sdk switched to local path-based dependency, and numerous new crates added. The construct module is entirely eliminated, and invoke/resolve commands are refactored with renamed arguments (tii_file, args_json, etc.). Bech32 encoding/decoding is migrated to newer API.

Changes

Cohort / File(s) Change Summary
Dependency Updates
Cargo.toml
Upgraded bech32 from 0.9.1 to 0.11.1; replaced versioned tx3-lang/tx3-cardano/tx3-sdk with local path-based tx3-sdk dependency; added ~15 new crates (comfy-table, crossterm, cryptoxide, ed25519-bip32, futures, hex, inquire, jsonrpsee, pallas, prost, rand, slug, strconv, toml, tracing, tracing-subscriber, url, regex, backoff, indexmap, num-format, tui-tree-widget, anyhow).
Invocation Workflow Refactoring
src/tx/common.rs
Introduced prepare_invocation() helper; replaced tx3_lang::ir::Type with WellKnownType; refactored load_args, inquire_args, define_args, and resolve_tx to operate on Invocation objects instead of ProtoTx; updated transaction selection logic and error handling to use WellKnownType variants.
Construct Module Removal
src/tx/construct/mod.rs, src/tx/construct/wizard.rs, src/tx/construct/add_input.rs, src/tx/construct/add_output.rs, src/tx/construct/build.rs, src/tx/construct/common.rs
Entire construct module and all submodules deleted, including CLI Args/Commands dispatching, TransactionBuilder class, and AST-based interactive transaction building workflow (wizard, add-input, add-output, build operations).
Command Argument Renames & Invocation Refactoring
src/tx/invoke.rs, src/tx/resolve.rs
Renamed struct fields: tx3_filetii_file, tx3_args_jsonargs_json, tx3_args_fileargs_file, tx3_templatetx_template; refactored invocation workflow to use prepare_invocation(), define_args(), and set_args() with new Invocation-based resolve_tx().
Command Surface Update
src/tx/mod.rs
Removed Construct variant from Commands enum and eliminated corresponding module reference and dispatch logic.
Bech32 API Migration
src/wallet/types.rs
Migrated from direct FromBase32/ToBase32 imports to Bech32 type API; updated HRP constants from &'static str to bech32::Hrp with parse_unchecked initialization; refactored to_bech32() to use encode::<Bech32>() and from_bech32() to use bech32::decode() with byte vector handling.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as CLI Command<br/>(invoke/resolve)
    participant TII as TII Protocol<br/>(Invocation)
    participant Args as Argument<br/>Resolution
    participant Provider as Provider
    participant Result as TxEnvelope

    rect rgb(230, 245, 250)
    Note over CLI,Result: New Invocation-based Workflow
    end

    CLI->>TII: prepare_invocation(tii_file, tx_template)
    activate TII
    TII->>TII: Load protocol from file
    TII-->>CLI: Return mutable Invocation
    deactivate TII

    CLI->>Args: define_args(invocation, args_json/file)
    activate Args
    Args->>Args: Resolve argument types from<br/>invocation.define_params()
    Args->>Args: Load from JSON/file or<br/>interactive inquiry
    Args-->>CLI: Return HashMap<String, ArgValue>
    deactivate Args

    CLI->>TII: invocation.set_args(args)
    activate TII
    TII->>TII: Store arguments in invocation
    deactivate TII

    CLI->>Provider: resolve_tx(invocation, provider)
    activate Provider
    Provider->>TII: Convert via<br/>invocation.into_trp_request()
    TII-->>Provider: Return TxEnvelope
    Provider-->>Result: Return signed/resolved TX
    deactivate Provider

    Result-->>CLI: TxEnvelope (ready for submit)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/tii

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2778be and 2a31210.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • Cargo.toml
  • src/tx/common.rs
  • src/tx/construct/add_input.rs
  • src/tx/construct/add_output.rs
  • src/tx/construct/build.rs
  • src/tx/construct/common.rs
  • src/tx/construct/mod.rs
  • src/tx/construct/wizard.rs
  • src/tx/invoke.rs
  • src/tx/mod.rs
  • src/tx/resolve.rs
  • src/wallet/types.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@scarmuega scarmuega merged commit 3ca1e3b into main Dec 23, 2025
5 of 10 checks passed
@scarmuega scarmuega deleted the refactor/tii branch December 23, 2025 14:09
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