Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVM: Consolidate TEAL and AVM versions #348

Merged
merged 2 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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