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
When calling a remote object method inside a parallelReduce.api_, an assumption error that should not be triggered can be seen.
To Reproduce
constctcSol=remote(slbContractAddress,SLB);voidctcSol.transferFrom(this,getAddress(),5);constslbsHeld=parallelReduce(5).invariant(balance()>0).invariant(slbsHeld>0).while(true).api_(Retailer.buySLBs,(volume)=>{check(volume<slbsHeld,"Cannot buy more SLBs than currently in the pool");return[0,(apiReturn)=>{voidctcSol.transfer(this,volume);apiReturn(true);returnslbsHeld;}]});
Here SLB is simply an ERC20 (I cannot use a Token interface because I need a more complicated interface later). When Retailer.buySLBs is called with, for example, 2, nothing should be triggered. Instead, at runtime, we get:
Error: Retailer.buySLBs errored with Error: Assertion failed: Retailer_buySLBs: Cannot buy more SLBs than currently in the pool
at reach standard library:57:5:application
at ./index.rsh:69:22:application call to "check" (defined at: reach standard library:49:32:function exp)
at ./index.rsh:67:22:application call to [unknown function] (defined at: ./index.rsh:67:22:function exp)
at ./index.rsh:67:22:application call to [unknown function] (defined at: ./index.rsh:67:22:function exp)
at /stdlib/dist/cjs/shared_impl.js:345:34
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Expected behavior
I would expect no error, the program should run normally. When the line void ctcSol.transfer(this, volume); is removed, everything works fine.
Thank you!
The text was updated successfully, but these errors were encountered:
Describe the error
When calling a remote object method inside a
parallelReduce.api_
, an assumption error that should not be triggered can be seen.To Reproduce
Here
SLB
is simply an ERC20 (I cannot use a Token interface because I need a more complicated interface later). WhenRetailer.buySLBs
is called with, for example,2
, nothing should be triggered. Instead, at runtime, we get:Expected behavior
I would expect no error, the program should run normally. When the line
void ctcSol.transfer(this, volume);
is removed, everything works fine.Thank you!
The text was updated successfully, but these errors were encountered: