#Assertions outside of a checked computation
1 messages · Page 1 of 1 (latest)
Sorry, it's not the assertion that is the problem, but actually determining if something is greater than or equal. e.g.
const hit = Circuit.if(
decrytpedRolls.hit.greaterThanOrEqual(attackingPiece.condition.hitRoll.value),
Bool(true),
Bool(false)
);
I would like to test this behavior, but I can't run it outside of a checked computation, and within the checked computation, I can't call toString() outside of a prover block
I'm finding that this pattern works, but is ugly in my test:
Circuit.runAndCheck(() => {
// logic is in this method
const newPhaseState = initialPhaseState.applyRangedAttackAction();
Circuit.asProver(() => {
expect(newPhaseState.root.toString()).toBe(expectedRoot.toString());
});
});