def add_two_rollback(ctx: Context) -> Context: n = ctx["n"] result = ctx.get("result", n) ctx.update(result=result - 2) return ctx
def add_two(ctx: Context) -> Context: n = ctx["n"] result = ctx.get("result", n) ctx.update(result=result + 2) return ctx
def add_two(ctx: Context) -> Context: number = ctx.get("n", 0) ctx["result"] = number + 2 return ctx