Getting Error("no log for ".concat(o_lab)) when using remote call #1354
Answered
by
jeapostrophe
lorenzopolidori
asked this question in
Q&A
-
I have two Reach applications, one calling the other through an API. The fist contract executes a // ...
const SPP = {
SolarPowerPlant_increaseCapacity: Fun([UInt], UInt),
SolarPowerPlant_decreaseCapacity: Fun([UInt], UInt),
SolarPowerPlant_increaseOutput: Fun([UInt], UInt),
};
// ...
const spp = remote(sppContractInfo, SPP);
// ... parallelReduce
if (withdrawn) {
A.interact.log("The token has been withdrawn");
const _ = spp.SolarPowerPlant_decreaseCapacity(power)
commit();
exit();
}
// ... other logic The second contract is quite straightforward: const SolarPowerPlant = Tuple(UInt, UInt);
export const main = Reach.App(() => {
const A = Participant('Admin', {
...hasConsoleLogger,
onReady: Fun(true, Null)
});
const V = API('SolarPowerPlant', {
stop: Fun([], Bool),
decreaseCapacity: Fun([UInt], UInt),
// other functions
});
init();
A.publish();
A.interact.onReady(getContract());
const [done, capacity, output] =
parallelReduce([false, 0, 0])
.invariant(balance() == 0)
.while(!done)
.api(V.decreaseCapacity,
((amount, k) => {
if (amount > capacity) {
k(0);
return [false, 0, output]
}
else {
const newCapacity = capacity - amount;
k(newCapacity);
return [false, newCapacity, output]
}
}))
.api(V.stop,
(() => { assume(this == A); }),
(() => 0),
(k => {
const isAdmin = this == A;
require(isAdmin);
k(isAdmin);
return [true, capacity, output]
}))
// other functions
.timeout(false);
commit();
exit();
}); The compiler does not give any errors, but when
If I remove the remote call, the error disappears. |
Beta Was this translation helpful? Give feedback.
Answered by
jeapostrophe
Aug 23, 2022
Replies: 1 comment
-
I will reply on the issue you created |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jeapostrophe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I will reply on the issue you created