tact icon indicating copy to clipboard operation
tact copied to clipboard

Debug's `dump` should support more data types

Open 0kenx opened this issue 1 year ago • 5 comments

Currently, debug's dump() supports String, Int, and Bool. It doesn't support dumping Address, Cell, Slice etc.

To enhance developer experience it makes sense for dump to support all native data types.

0kenx avatar Apr 07 '24 20:04 0kenx

Address is supported since PR #175, will be released in v1.3.0

anton-trunov avatar Apr 08 '24 05:04 anton-trunov

Address is supported since PR #175, will be released in v1.3.0

Which makes all native data types supported in dump() function. Soon-to-be documented

novusnota avatar Apr 08 '24 05:04 novusnota

I think we can implement formatted recursive dumping for cells and slices, the same way as csr. from Fift works.

Gusarich avatar Apr 19 '24 10:04 Gusarich

I think we can implement formatted recursive dumping for cells and slices, the same way as csr. from Fift works.

While trying to implement this feature, I've came to a problem: STRDUMP doesn't allow printing of a string longer than 127 symbols because it only takes data from the current slice which is limited by 1023 bits. So the implementation will break if cells have more than 508 bits (even less with the indentation).

So I think there's no good way to implement beautiful Cell and Slice dumping at the moment. However, if something like DUMPSLICE is ever introduced in TVM we'll add it to Tact's dump function.

Gusarich avatar Apr 19 '24 12:04 Gusarich

Let's keep this as a reminder

anton-trunov avatar Apr 21 '24 07:04 anton-trunov