diff --git a/tvm/cell/cell.go b/tvm/cell/cell.go index c9e788c7..abfb8cf1 100644 --- a/tvm/cell/cell.go +++ b/tvm/cell/cell.go @@ -103,24 +103,24 @@ func (c *Cell) PeekRef(i int) (*Cell, error) { } func (c *Cell) Dump(limitLength ...int) string { - var lim = (1024 << 20) * 16 + var lim = uint64(1024<<20) * 16 if len(limitLength) > 0 { // 16 MB default lim - lim = limitLength[0] + lim = uint64(limitLength[0]) } return c.dump(0, false, lim) } func (c *Cell) DumpBits(limitLength ...int) string { - var lim = (1024 << 20) * 16 + var lim uint64 = (1024 << 20) * 16 if len(limitLength) > 0 { // 16 MB default lim - lim = limitLength[0] + lim = uint64(limitLength[0]) } return c.dump(0, true, lim) } -func (c *Cell) dump(deep int, bin bool, limitLength int) string { +func (c *Cell) dump(deep int, bin bool, limitLength uint64) string { sz, data, _ := c.BeginParse().RestBits() var val string @@ -156,14 +156,14 @@ func (c *Cell) dump(deep int, bin bool, limitLength int) string { str += "," } - if len(str) > limitLength { + if uint64(len(str)) > limitLength { break } } str += strings.Repeat(" ", deep) + "}" } - if len(str) > limitLength { + if uint64(len(str)) > limitLength { str = str[:limitLength] }