Skip to content

Commit

Permalink
AVM: Consolidate TEAL and AVM versions (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldiamant authored Aug 1, 2022
1 parent 46577d5 commit 5e373bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/algorand/algosdk/logic/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,14 @@ public static ProgramData readProgram(byte[] program, List<byte[]> args) throws
}
// costs calculated dynamically starting in v4
if (version < 4 && cost > MAX_COST) {
throw new IllegalArgumentException("program too costly for Teal version < 4. consider using v4.");
throw new IllegalArgumentException("program too costly for version < 4. consider using v4.");
}

return new ProgramData(true, ints, bytes);
}

/**
* Retrieves TEAL supported version
* Retrieves supported program version
* @return int
* @throws IOException
*/
Expand All @@ -269,7 +269,7 @@ public static int getLogicSigVersion() throws IOException {
}

/**
* Retrieves max supported version of TEAL evaluator
* Retrieves max supported program version of evaluator
* @return int
* @throws IOException
*/
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/algorand/algosdk/logic/TestLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void testCheckProgramCostly() throws Exception {
program2[0] = v;
assertThatThrownBy(() -> readProgram(program2, args))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("program too costly for Teal version < 4. consider using v4.");
.hasMessage("program too costly for version < 4. consider using v4.");
}

for (byte v : versions) {
Expand All @@ -236,7 +236,7 @@ public void testCheckProgramInvalidOpcode() throws Exception {
}

@Test
public void testCheckProgramTealV2() throws Exception {
public void testCheckProgramV2() throws Exception {
assertThat(getEvalMaxVersion()).isGreaterThanOrEqualTo(2);
assertThat(getLogicSigVersion()).isGreaterThanOrEqualTo(2);

Expand Down Expand Up @@ -269,7 +269,7 @@ public void testCheckProgramTealV2() throws Exception {
}

@Test
public void testCheckProgramTealV3() throws Exception {
public void testCheckProgramV3() throws Exception {
assertThat(getEvalMaxVersion()).isGreaterThanOrEqualTo(3);
assertThat(getLogicSigVersion()).isGreaterThanOrEqualTo(3);

Expand Down Expand Up @@ -311,7 +311,7 @@ public void testCheckProgramTealV3() throws Exception {
}

@Test
public void testCheckProgramTealV4() throws Exception {
public void testCheckProgramV4() throws Exception {
assertThat(getEvalMaxVersion()).isGreaterThanOrEqualTo(4);

{
Expand Down Expand Up @@ -379,7 +379,7 @@ public void testCheckProgramTealV4() throws Exception {
}

@Test
public void testCheckProgramTealV5() throws Exception {
public void testCheckProgramV5() throws Exception {
assertThat(getEvalMaxVersion()).isGreaterThanOrEqualTo(5);

{
Expand Down Expand Up @@ -414,7 +414,7 @@ public void testCheckProgramTealV5() throws Exception {
}

@Test
public void testCheckProgramTealV6() throws Exception {
public void testCheckProgramV6() throws Exception {
assertThat(getEvalMaxVersion()).isGreaterThanOrEqualTo(6);

{
Expand Down

0 comments on commit 5e373bd

Please sign in to comment.