let builder = new BitBuilder();
builder.writeInt(0, 1); // value is not zero or -1 for 1 bits. Got 0
The error occurs because the variable value is checked on line 155 instead of v from line 148.
value can be a number or a BigInt, so comparing it with BigInt constants will not work.
This code will throw an error, but should work
The error occurs because the variable
value
is checked on line 155 instead ofv
from line 148. value can be a number or a BigInt, so comparing it with BigInt constants will not work.https://github.com/ton-org/ton-core/blob/00fa47e03c2a78c6dd9d09e517839685960bc2fd/src/boc/BitBuilder.ts#L147-L160
Same problem with