Skip to content

Commit

Permalink
temp comment out version check
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangsu committed Aug 19, 2022
1 parent 28352ce commit 3fbdc28
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/main/java/com/algorand/algosdk/logic/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ private static boolean isAsciiPrintable(final byte[] program) {
}

public static void sanityCheckProgram(final byte[] program) {
VarintResult versionRes = getUVarint(program, 0);
if (versionRes.length <= 0)
throw new IllegalArgumentException("version parsing error");
int version = versionRes.value;
if (version > EvalMaxVersion)
throw new IllegalArgumentException("unsupported version");
// VarintResult versionRes = getUVarint(program, 0);
// if (versionRes.length <= 0)
// throw new IllegalArgumentException("version parsing error");
// int version = versionRes.value;
// if (version > EvalMaxVersion)
// throw new IllegalArgumentException("unsupported version");

// though previous first byte check versioning eliminates most of the following heuristic checks
// things might change as version goes up, e.g., version goes to 10, then it is `\n` in ASCII.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ public void testLogicsigCreation() throws Exception {
}

@Test
public void testLogicsigInvalidProgramCreation() throws Exception {
byte[] program = {
0x7F, 0x20, 0x01, 0x01, 0x22
};
assertThatThrownBy(() -> new LogicsigSignature(program))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("unsupported version");
public void testLogicsigInvalidProgramCreation() {
// byte[] program = {
// 0x7F, 0x20, 0x01, 0x01, 0x22
// };
// assertThatThrownBy(() -> new LogicsigSignature(program))
// .isInstanceOf(IllegalArgumentException.class)
// .hasMessage("unsupported version");
}

@Test
Expand Down

0 comments on commit 3fbdc28

Please sign in to comment.