-
Notifications
You must be signed in to change notification settings - Fork 316
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
fix: performing 2nd swap not working #986
Conversation
The test added here is copying the first few steps of the previous test, "alice swaps bob 10 A for 1 B". For some reason, the second time you simulate this transaction, it is calculating that no non-invoker signing is needed! Haven't figured out why yet. Note that this is an order-dependent test. The new one only functions as expected because mocha runs the tests in the same order every time.
Adds a toXDR and fromXDR for AssembledTransaction class. Also adds a txFromXDR to the Client class. Changes the swap test to use this flow. Limitations: If you use the XDR multi-auth flow, you must re-simulate before the final `signAndSend` call. This is due to the fact that we can't serialize the XDR of the transaction envelope with the results of the simulation. If we want to do this, we would need to add an `AssembledTransaction` type to XDR in `stellar-base`. --------- Co-authored-by: George <[email protected]>
The new test added here shows that you can edit a transaction with `tx.raw = cloneFrom(tx.build)` and that the `tx.simulationData` will be updated correctly.
Co-authored-by: Chad Ostrowski <[email protected]> Co-authored-by: blaineheffron <[email protected]> Co-authored-by: George <[email protected]>
…ion` (stellar#992) * add auto restore functionality for contract client * extract getAccount to utils * add changelog entry for auto restore functionality Co-authored-by: Chad Ostrowski <[email protected]> Co-authored-by: blaineheffron <[email protected]>
* Upgrade dev dependencies * Upgrade stellar-base to latest version
Fixed by increasing the starting token balance. The issue was that when the swap was constructed, it would simulate and the simulation would fail so the auth entries never got added to the transaction. Simulation would fail when it tried to simulate a transfer of tokens but the balance was not enough. |
ohhhh 🤦🏼 ok, good to know that there's no order dependency. Should have checked for a simulation error right away. |
The test added here is copying the first few steps of the previous test, "alice swaps bob 10 A for 1 B". For some reason, the second time you simulate this transaction, it is calculating that no non-invoker signing is needed! Haven't figured out why yet.
Note that this is an order-dependent test. The new one only functions as expected because mocha runs the tests in the same order every time.
See the failing test here on CI: