Closed arcj0 closed 2 years ago
Ok, I'm rewriting this to a jest test-case, cause testing and clicking in a browser is really counter productive.
From further analysis - for some reason the interaction with IW does not show on a call stack
As a result, a tag 'Interact-Write' is not being generated.
ok, I've found the root cause. I'll describe it in more details on Monday, but the fixes and some explanation are in this PR https://github.com/warp-contracts/warp/pull/223
Most important stuff: https://github.com/warp-contracts/warp/pull/223#pullrequestreview-1110971331 (see the comments in the contract code) https://github.com/warp-contracts/warp/pull/223#discussion_r973219409
Also - I've rewritten your vue example to a jest testcase - https://github.com/warp-contracts/warp/pull/223#discussion_r973222958
To sum-up:
Do not make SmartWeave.contracts.write
and SmartWeave.contracts.readContractState
in a same parent transaction on the same contract.
The latest state of the callee contract (after making an internal write) is in the result returned by the SmartWeave.contracts.write
.
added protection in https://github.com/warp-contracts/warp/pull/223#issue-1376187865
released in 1.2.7
To see the issue, here's a test app
After the internal write is made, you can see the state change, but if you read the contract using another WarpFactory connection, the claims aren't processed.