Closed BlaineHeffron closed 3 months ago
A couple of interesting things I found:
restorePreamble
to construct the restoreFootprint
operation always worked. In other words, I never needed to perform the actual restore of the contract wasm hash / contract wasm footprints. I did write code to do that in case its needed, and I can add that as a method if it is needed. I just wasn't able to find a test case where it was.The problem I found was that the sequence number increments the first time the AssembledTransaction is built, and since that method call doesn't go through it is then off by 1 for the restoreFootprint operation.
Yeahh this has been a long-standing issue with the Account
object. That's why TransactionBuilder.cloneFrom()
does this janky -1n
workaround. We can definitely make changes to that interface and its implementations, though. See also https://github.com/stellar/js-stellar-base/issues/574 and https://github.com/stellar/js-stellar-base/issues/436 for more stuff related to this. I'm definitely for it!
All comments are addressed except regarding the test. I think we can use this test for now until we have a way of using a quickstart image with a short minimum TTL that would be suitable for this type of e2e test. Changelog has been added.
@BlaineHeffron if you can resolve the conflicts I can merge this asap!
@BlaineHeffron is out today! I resolved the conflicts but didn't have permission to push to Blaine's fork, so I made a new PR, if you want to merge that one and close this one, @Shaptic! https://github.com/stellar/js-stellar-sdk/pull/991
Adds the ability to set
restore
to true in contract method invocation options. This will utilize the signTransaction method to sign a restoreFootprint operation when found that it is needed during a simulation.