Draft
Conversation
Still need to do some FFI From impls
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new algod_client_ffi crate to enable FFI (Foreign Function Interface) compatibility for the Algorand algod client. The separation addresses an architectural limitation where feature flags prevented proper FFI integration in the existing utils package.
Key changes:
- Creates FFI-compatible wrapper models that convert between Rust native types and FFI-safe types
- Implements bidirectional conversion traits (From/TryFrom) for seamless type translation
- Establishes a complete API client interface with error handling
Reviewed Changes
Copilot reviewed 298 out of 525 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/lib.rs |
Entry point with uniffi scaffolding and module exports |
src/apis/mod.rs |
Error type definitions and API endpoint module organization |
src/apis/client.rs |
Main FFI client implementation wrapping the Rust algod client |
src/apis/*.rs (error modules) |
Individual error type conversions for each API endpoint |
src/apis/parameter_enums.rs |
FFI-compatible enum definitions for API parameters |
src/models/mod.rs |
Model module structure with custom JSON value handling |
src/models/*.rs (model files) |
FFI wrapper structs with conversion implementations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current approach that uses a feature flag makes it impossible to actually use the FFI algod client in FFI utils because utils FFI wraps the non-FFI utils which uses the non-FFI algod. Thus we need a separate FFI crate so we can convert between the rust models and the FFI-compatible models.
Closes #297