Skip to content

Commit

Permalink
Merge branch 'pr-65' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	address/README.md
#	address/pom.xml
#	bitstring/README.md
#	bitstring/pom.xml
#	cell/README.md
#	cell/pom.xml
#	emulator/README.md
#	emulator/pom.xml
#	fift/README.md
#	fift/pom.xml
#	func/README.md
#	func/pom.xml
#	liteclient/README.md
#	liteclient/pom.xml
#	mnemonic/README.md
#	mnemonic/pom.xml
#	pom.xml
#	smartcontract/README.md
#	smartcontract/pom.xml
#	tl/pom.xml
#	tonconnect/README.md
#	tonconnect/pom.xml
#	tonlib/README.md
#	tonlib/pom.xml
#	tweetnacl-java-8/pom.xml
#	utils/README.md
#	utils/pom.xml
  • Loading branch information
neodix42 committed Oct 14, 2024
2 parents 06413b3 + f41445c commit 9524998
Show file tree
Hide file tree
Showing 3 changed files with 445 additions and 299 deletions.
20 changes: 10 additions & 10 deletions cell/src/main/java/org/ton/java/cell/Cell.java
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,15 @@ static BocFlags parseBocFlags(byte data) {
* @return String
*/
public String print(String indent) {
StringBuilder s = new StringBuilder(indent + "x{" + bits.toHex() + "}\n");
String t = "x";
if (this.type == CellType.MERKLE_PROOF) {
t = "p";
} else if (this.type == CellType.MERKLE_UPDATE) {
t = "u";
} else if (this.type == CellType.PRUNED_BRANCH) {
t = "P";
}
StringBuilder s = new StringBuilder(indent + t + "{" + bits.toHex() + "}\n");
if (nonNull(refs) && !refs.isEmpty()) {
for (Cell i : refs) {
if (nonNull(i)) {
Expand All @@ -580,15 +588,7 @@ public String print(String indent) {
}

public String print() {
StringBuilder s = new StringBuilder("x{" + bits.toHex() + "}\n");
if (nonNull(refs) && !refs.isEmpty()) {
for (Cell i : refs) {
if (nonNull(i)) {
s.append(i.print(" "));
}
}
}
return s.toString();
return print("");
}

/** Saves BoC to file */
Expand Down
1 change: 1 addition & 0 deletions cell/src/main/java/org/ton/java/cell/CellBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public static CellBuilder beginCell(int bitSize) {
* Converts a builder into an ordinary cell.
*/
public Cell endCell() {
cell.levelMask = cell.resolveMask();
if (cell.getHashes().length == 0) {
cell.calculateHashes();
}
Expand Down
Loading

0 comments on commit 9524998

Please sign in to comment.