-
Notifications
You must be signed in to change notification settings - Fork 111
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
Bug: json.Unmarshal cannot directly parse Transaction interface in SimulateTransactionInput #608
Comments
Hello, @thiagodeev .Yes, I had modified some code before, so the line numbers in my previous screenshot do not match. Please take a look at this new screenshot I provided above. This is the code from the starknetgo project that I re-cloned, and it is still throwing errors. |
The issue occurs when running tests in the mainnet env. |
Sorry @haisenCx, I forgot this test was supposed to run on mainnet 😅. |
Yes,My pleasure🤓 |
Thanks! 😁 Feel free to think of other ideas, bonus for simplicity |
Okay, I think your suggestion is the right way, we should follow the spec. I'll take another look, and then I'll post my solution here later. |
Hello @thiagodeev, do you mean to change the Transaction in SimulateTransactionInput struct to the BroadcastTxn structure? I see that a BroadcastTxn struct has already been defined in the project. Can it be used directly? |
Description
I encountered a bug while running unit tests using starknetGo. The issue occurs when the code
"err = simulateTxIn.UnmarshalJSON(simulateTxnRaw)" attempts to parse the ./tests/trace/simulateInvokeTx.json file.
The error message is the img below:
I think the error message indicates that json.Unmarshal cannot directly parse the Transaction interface in the SimulateTransactionInput struct
Steps to Reproduce
Run the test TestSimulateTransaction
Suggested Fix
To fix this issue, I suggest implementing a custom UnmarshalJSON method for the SimulateTransactionInput struct. This method will handle the parsing of the Transaction interface by determining the specific struct type.
The text was updated successfully, but these errors were encountered: