-
Notifications
You must be signed in to change notification settings - Fork 4
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
simulateTransaction #19
Conversation
WalkthroughThe pull request updates the litesvm dependency in Cargo.toml to include the "nodejs-internal" feature. In the RPC module, the simulate_transaction function signature is modified to return a BoxFuture for asynchronous processing, and send_transaction has been streamlined by simplifying its configuration handling. Additionally, a new function to transform transaction metadata into UI accounts has been introduced in the utils module, along with corresponding import adjustments to support related types. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant RPC
participant AsyncWorker
Client->>RPC: simulate_transaction(meta, data, config)
RPC->>AsyncWorker: Process simulation asynchronously
AsyncWorker-->>RPC: Return RpcResponse result
RPC-->>Client: Return BoxFuture wrapping result
sequenceDiagram
participant Caller
participant Utils
Caller->>Utils: transform_tx_metadata_to_ui_accounts(meta)
Utils-->>Caller: Return Vec<UiInnerInstructions>
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Hey @Dodecahedr0x I just want to ask concerning your PRs , how did you test your methods? I'm getting the hang of the codebase but I just want more clarity , thanks |
Hey, I'm using postman for now, but it would be nice to have tests directly in the codebase |
Setting up a robust testing infrastructure would be amazing, @adpthegreat is this something you think you could help with? |
@MicaiahReid can help too, he has extensive experience with this. |
I noticed the |
) | ||
.await; | ||
|
||
let mut state_writer = meta.get_state_mut()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be mutating if we're simulating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only to insert missing accounts using the fetched ones. Simulating uses an immutable reference of the SVM
# Conflicts: # crates/core/src/rpc/full.rs
Addresses #23.
It seems that the way the LiteSVM works and how it's used in the code prevents mutating it. I'm trying to find a way to get to it but might have to make a PR to LiteSVM at some point.
Summary by CodeRabbit
Summary by CodeRabbit