feat: separate build and simulate steps in TransactionBuilder#121
Open
thinktanktom wants to merge 1 commit intoOpenZeppelin:mainfrom
Open
feat: separate build and simulate steps in TransactionBuilder#121thinktanktom wants to merge 1 commit intoOpenZeppelin:mainfrom
thinktanktom wants to merge 1 commit intoOpenZeppelin:mainfrom
Conversation
- Extract simulation logic into standalone simulate_transaction() function - Refactor simulate_and_build() to use the new function internally - Add test for simulate_transaction() - Update lib.rs to export simulate_transaction() - Maintain backward compatibility with existing simulate_and_build() API Closes OpenZeppelin#48
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.
Description
Fixes #48
This PR separates the building and simulation steps in the
TransactionBuilderAPI to provide more flexibility to users.Changes
simulate_transaction(tx, env, account)- standalone function that simulates an already-built transactionsimulate_and_build()now internally callsbuild()thensimulate_transaction()mutsimulate_and_build()API continues to work exactly as beforetest_simulate_transaction()to verify the new function works correctlysimulate_transactionto public API inlib.rsNew API Usage
Option 1: Build and simulate separately (new flexibility)
Option 2: Build and simulate together (existing convenience)
Testing
test_simulate_transaction()added and passingcargo fmtappliedcargo clippycleanChecklist
cargo fmtcargo clippy