Reach application is dangerous to run on Algorand because of remote call #1345
-
From a Reach application deployed on Algorand I am trying to call an API implemented in a second Reach application using // ...
const SPP = {
increaseCapacity: Fun([UInt], UInt)
};
init();
A.only(() => {
const [tok, price, contractInfo] = declassify([interact.tok, interact.price, interact.contractInfo]);
});
A.publish(tok, price, contractInfo);
commit();
const spp = remote(contractInfo, SPP);
const cap = spp.increaseCapacity(20)
commit()
// ... When I compile the program, I get the following warning:
When I run the programme, I get the following message:
and eventually the remote call fails. Does that mean that effectively we cannot call an API implemented in a separate contract using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
No, it does not mean that. It just means that you need to make sure that it properly. The warning is saying "Reach can't check to make sure you are calling this correctly, so it will fail if you don't". But, Reach does give you the tools to call it correctly, provided you know how. You basically need to extend the call with these things --- https://docs.reach.sh/rsh/consensus/#p_72 --- and if you show the definition of |
Beta Was this translation helpful? Give feedback.
No, it does not mean that. It just means that you need to make sure that it properly. The warning is saying "Reach can't check to make sure you are calling this correctly, so it will fail if you don't". But, Reach does give you the tools to call it correctly, provided you know how. You basically need to extend the call with these things --- https://docs.reach.sh/rsh/consensus/#p_72 --- and if you show the definition of
increaseCapacity
in the CALLED contract, I could tell you just what you need if you can't figure it out. (You can also compile the CALLED contract with REACH_DEBUG=Y and it will print out basically everything you need to know.)