-
Notifications
You must be signed in to change notification settings - Fork 0
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
Simulate execute on solana SDK [DPA-1418] #250
Conversation
🦋 Changeset detectedLatest commit: c99c960 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Quality Gate passedIssues Measures |
return fmt.Errorf("not implemented") | ||
} | ||
|
||
func (s *Simulator) SimulateOperation( |
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.
this was kind of what i was trying to avoid in SetRoot - another implementation for simulation, thats why i was experimenting the simulatable framework so we can easily make the existing implementation simulatable.
With the framework, it would be only a few lines of change for you here i believe? And the benefit is we get to test the most of the actual implementation of ExecuteOperation
. (same code)
@@ -153,6 +153,48 @@ func mockSolanaTransaction( | |||
}).Once() | |||
} | |||
|
|||
func mockSolanaSimulation( |
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.
haha damn, looks like we overlap again lol
super seeded by #277 |
Adds the simulate operation functionality for the solana SDK
Summary
This pull request introduces a new
Simulator
class for the Solana SDK, along with corresponding tests. The most important changes include the implementation of theSimulator
class, a new test suite for theSimulator
, and a helper function for mocking Solana transactions.New
Simulator
class implementation:sdk/solana/simulator.go
: Added a newSimulator
class with methods for simulating operations and setting roots. This includes theNewSimulator
constructor and methodsSimulateSetRoot
andSimulateOperation
.Testing:
sdk/solana/simulator_test.go
: Added tests for theSimulator
class, includingTestNewSimulator
to test the constructor andTestSimulator_SimulateOperation
to test theSimulateOperation
method.Helper function for mocking:
sdk/solana/utils_test.go
: Added a new helper functionmockSolanaSimulation
to mock Solana transaction simulations in tests.