Skip to content

Commit b160b34

Browse files
committed
fix default functions Cell (#79)
1 parent d916e2f commit b160b34

File tree

1 file changed

+36
-11
lines changed
  • ton-kotlin-cell/src/commonMain/kotlin/org/ton/cell

1 file changed

+36
-11
lines changed

ton-kotlin-cell/src/commonMain/kotlin/org/ton/cell/Cell.kt

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,47 @@ public interface Cell {
7575
public const val MAX_BITS_SIZE: Int = 1023
7676

7777
@JvmStatic
78-
public fun of(hex: String, vararg refs: Cell, isExotic: Boolean = false): Cell =
78+
public fun empty() : Cell = CellImpl.of(BitString.empty(), emptyList())
79+
80+
@JvmStatic
81+
public fun of(hex: String): Cell =
82+
CellImpl.of(BitString(hex), emptyList())
83+
84+
@JvmStatic
85+
public fun of(hex: String, vararg refs: Cell): Cell =
86+
CellImpl.of(BitString(hex), refs.toList())
87+
88+
@JvmStatic
89+
public fun of(hex: String, vararg refs: Cell, isExotic: Boolean): Cell =
7990
CellImpl.of(BitString(hex), refs.toList(), isExotic)
8091

8192
@JvmStatic
82-
public fun of(
83-
bits: BitString = BitString(),
84-
refs: Iterable<Cell> = emptyList(),
85-
isExotic: Boolean = false
86-
): Cell = CellImpl.of(bits, refs.toList(), isExotic)
93+
public fun of(hex: String, refs: Iterable<Cell>): Cell =
94+
CellImpl.of(BitString(hex), refs.toList())
95+
96+
@JvmStatic
97+
public fun of(hex: String, refs: Iterable<Cell>, isExotic: Boolean): Cell =
98+
CellImpl.of(BitString(hex), refs.toList(), isExotic)
99+
100+
@JvmStatic
101+
public fun of(bits: BitString): Cell =
102+
CellImpl.of(bits, emptyList())
103+
104+
@JvmStatic
105+
public fun of(bits: BitString, vararg refs: Cell): Cell =
106+
CellImpl.of(bits, refs.toList())
107+
108+
@JvmStatic
109+
public fun of(bits: BitString, vararg refs: Cell, isExotic: Boolean): Cell =
110+
CellImpl.of(bits, refs.toList(), isExotic)
111+
112+
@JvmStatic
113+
public fun of(bits: BitString, refs: Iterable<Cell>): Cell =
114+
CellImpl.of(bits, refs.toList())
87115

88116
@JvmStatic
89-
public fun of(
90-
bits: BitString,
91-
vararg refs: Cell,
92-
isExotic: Boolean = false
93-
): Cell = CellImpl.of(bits, refs.toList(), isExotic)
117+
public fun of(bits: BitString, refs: Iterable<Cell>, isExotic: Boolean): Cell =
118+
CellImpl.of(bits, refs.toList(), isExotic)
94119

95120
@JvmStatic
96121
public fun toString(cell: Cell): String = buildString {

0 commit comments

Comments
 (0)