{'/error/bad_request': 'while resolving result: while resolving Int_7f81aa963c40: not a Number: foo'}
. This program is small enough that it's easy to search for "foo," but in larger programs the auto-generated names like Int_7f81aa963c40
can be very unhelpful when debugging.Op
context:{'/error/bad_request': 'while resolving result: while resolving b: not a Number: foo'}
. Now you can at least tell that the error is happening with TinyChain tries to resolve state b
.Op
is to make sure that each step of your program is only executed once. For example:updated
is a flow control, not a State
, so it will be executed again every time it's referenced. Assigning a name solves this problem:x.write(x + 1)
the name update
, so each reference to cxt.update
will resolve the result of updating x, not the update op itself.x
is zero-valued, but it may be confusing in the context of a larger program because you won't necessarily know where the error is happening. To get more information, you can add validation checks to your code:Op
you need to inspect to begin with. To make this determination, you can turn on debug logging:logging.debug
in your code to get information about the state of the program at compile-time.