You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Code blocks on RPC sendTransaction page fail #1390
It shows creating a contract invocation and then signing and submitting the transaction without calling prepare_transaction. The transaction is guaranteed to error in this case because it's not configured with fees or resources.
To make the transaction succeed, at the least you need to call the following prior to signing:
2⃣ A second issue is that all the examples (Python, JS, Java) still wouldn't work out of the box, because they references a contract that doesn't exist. Instead of using a random increment contract, the example could be written to use the CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC contract, which is the native asset on the test network. The example could get the balance of a known predictable address such as the network root account.
The example would then create a much better developer experience, be ready to go without the developer having to navigate so many errors.
The reason for the failure is as @leighmcculloch mentioned, we did not call prepare_transaction. I will submit a PR later to fix this use case.
Additionally, after each testnet reset, the use cases may become unexecutable, users need to manually modify the keys and contract addresses. Perhaps we can prepare a preset script to initialize these keys and contracts after each testnet reset?
We do have "someday" plans to create a testnet reset script that would help with a lot of similar issues in the docs. We closed the issue (#519) since it was a bit stale, but we still have it "on the books" in our discussions "dream journal" (#1197)
Activity
ElliotFriend commentedon Mar 18, 2025
@overcat Any chance you could chime in with some insights or a PR?
overcat commentedon Mar 19, 2025
The reason for the failure is as @leighmcculloch mentioned, we did not call
prepare_transaction. I will submit a PR later to fix this use case.Additionally, after each testnet reset, the use cases may become unexecutable, users need to manually modify the keys and contract addresses. Perhaps we can prepare a preset script to initialize these keys and contracts after each testnet reset?
ElliotFriend commentedon Mar 19, 2025
Thanks so much for the PR @overcat!!
We do have "someday" plans to create a testnet reset script that would help with a lot of similar issues in the docs. We closed the issue (#519) since it was a bit stale, but we still have it "on the books" in our discussions "dream journal" (#1197)