Skip to content

Commit

Permalink
Merge pull request #1 from neodix42/adjustments
Browse files Browse the repository at this point in the history
minor adjustments
  • Loading branch information
h6x0r authored Oct 9, 2024
2 parents 8c0eda8 + 893e326 commit 49295c9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>io.github.neodix42</groupId>
<artifactId>smartcontract</artifactId>
<version>0.6.0</version>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/ton/Disassembler.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static String decompile(CellSlice cs, Integer indent) {

public static String decompileMethodsMap(CellSlice cs, int keyLen, Integer indent) {
TonHashMap methodsMap = cs.loadDict(keyLen,
k -> k.readUint(keyLen).intValue(),
k -> k.readInt(keyLen).intValue(),
v -> v
);
Map<Integer, String> methodsMapDecompiled = new LinkedHashMap<>();
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/ton/consts/KnownMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class KnownMethods {
map.put(128411, "get_royalty_params");
map.put(129619, "get_telemint_auction_config");
map.put(524286, "run_ticktock");
map.put(524287, "recv_external"); // two keys for the method name

METHODS = Collections.unmodifiableMap(map);
}
Expand Down
10 changes: 8 additions & 2 deletions src/test/java/org/ton/DisassemblerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down Expand Up @@ -51,12 +52,11 @@ public void shouldDisassembleNft() throws Exception {
assertEquals(loadSnapshot("nft"), result);
}

@Disabled
@Test
public void shouldDumpMethod() throws Exception {
String code = loadFiftFromFunc();
Cell codeCell = Cell.fromBoc(code);
String result = Disassembler.fromCode(codeCell);
String result = normalizeLines(Disassembler.fromCode(codeCell));
assertEquals(loadSnapshot("dump"), result);
}

Expand Down Expand Up @@ -133,6 +133,12 @@ private String loadFiftFromFunc() throws IOException {

if (Files.notExists(fiftFile.toPath())) {
Files.write(fiftFile.toPath(), fiftCode.getBytes());
if (!fiftCode.contains("2 boc+>B")) {
Files.write(
fiftFile.toPath(),
"2 boc+>B dup Bx.".getBytes(),
StandardOpenOption.APPEND);
}
}

FiftRunner fiftRunner = FiftRunner.builder().build();
Expand Down
5 changes: 0 additions & 5 deletions src/test/resources/test.fift

This file was deleted.

0 comments on commit 49295c9

Please sign in to comment.