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

soroban-rpc: refactor libpreflight #875

Merged
merged 17 commits into from
Aug 21, 2023

Conversation

2opremio
Copy link
Contributor

@2opremio 2opremio commented Aug 20, 2023

  • Split out FFI conversions from actual preflight computations. I added a new file preflight.rs which contains the actual preflight computations, separate from the Go<->Rust ffi interfacing (which is the only thing left in lib.rs).
  • Use the anyhow crate to:
  • Some other minor changes, making the code more idiomatic/readable.
  • Fix a couple of memory leaks in free_preflight_result()

Copy link
Contributor

@paulbellamy paulbellamy left a comment

Choose a reason for hiding this comment

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

Now that preflight.rs is independent, it would be great to add some unit tests (which could help show me which bugs you fixed, because right now I've no idea).

cmd/soroban-rpc/lib/preflight/src/fees.rs Show resolved Hide resolved
cmd/soroban-rpc/lib/preflight/src/fees.rs Outdated Show resolved Hide resolved
cmd/soroban-rpc/lib/preflight/src/fees.rs Outdated Show resolved Hide resolved
cmd/soroban-rpc/lib/preflight/src/lib.rs Show resolved Hide resolved
cmd/soroban-rpc/lib/preflight/src/lib.rs Outdated Show resolved Hide resolved
@2opremio
Copy link
Contributor Author

Now that preflight.rs is independent, it would be great to add some unit tests (which could help show me which bugs you fixed, because right now I've no idea).

Good idea, I will do it in a separate PR though, although the memory leak bugs I fixed were in lib.rs

Copy link
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

Few comments; overall looks great.

@2opremio
Copy link
Contributor Author

@paulbellamy PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

soroban-rpc: Improve error reporting in preflight library
4 participants