Class Logic

java.lang.Object
com.algorand.algosdk.logic.Logic

@Deprecated
public class Logic
extends java.lang.Object
Deprecated.
this class is deprecated for relying on metadata (`langspec.json`) that does not accurately represent opcode behavior across program versions.
Logic class provides static checkProgram function that can be used for client-side program validation for size and execution cost.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    protected static class  Logic.ByteConstBlock
    Deprecated.
     
    protected static class  Logic.IntConstBlock
    Deprecated.
     
    static class  Logic.ProgramData
    Deprecated.
    Metadata related to a teal program.
    static class  Logic.VarintResult
    Deprecated.
    Metadata related to a varint parsed from teal program data.
  • Constructor Summary

    Constructors
    Constructor Description
    Logic()
    Deprecated.
     
  • Method Summary

    Modifier and Type Method Description
    static boolean checkProgram​(byte[] program, java.util.List<byte[]> args)
    Deprecated.
    Performs basic program validation: instruction count and program cost
    static int getEvalMaxVersion()
    Deprecated.
    Retrieves max supported program version of evaluator
    static int getLogicSigVersion()
    Deprecated.
    Retrieves supported program version
    static Logic.VarintResult getUVarint​(byte[] buffer, int bufferOffset)
    Deprecated.
    Given a varint, get the integer value
    static byte[] putUVarint​(int value)
    Deprecated.
    Varints are a method of serializing integers using one or more bytes.
    protected static Logic.ByteConstBlock readByteConstBlock​(byte[] program, int pc)
    Deprecated.
     
    protected static Logic.IntConstBlock readIntConstBlock​(byte[] program, int pc)
    Deprecated.
     
    static Logic.ProgramData readProgram​(byte[] program, java.util.List<byte[]> args)
    Deprecated.
    Performs basic program validation: instruction count and program cost
    protected static Logic.ByteConstBlock readPushByteOp​(byte[] program, int pc)
    Deprecated.
     
    protected static Logic.IntConstBlock readPushIntOp​(byte[] program, int pc)
    Deprecated.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Logic

      public Logic()
      Deprecated.
  • Method Details

    • putUVarint

      public static byte[] putUVarint​(int value)
      Deprecated.
      Varints are a method of serializing integers using one or more bytes. Smaller numbers take a smaller number of bytes. Each byte in a varint, except the last byte, has the most significant bit (msb) set – this indicates that there are further bytes to come. The lower 7 bits of each byte are used to store the two's complement representation of the number in groups of 7 bits, the least significant group first. https://developers.google.com/protocol-buffers/docs/encoding
      Parameters:
      value - being serialized
      Returns:
      byte array holding the serialized bits
    • getUVarint

      public static Logic.VarintResult getUVarint​(byte[] buffer, int bufferOffset)
      Deprecated.
      Given a varint, get the integer value
      Parameters:
      buffer - serialized varint
      bufferOffset - position in the buffer to start reading from
      Returns:
      pair of values in an array: value, read size
    • checkProgram

      public static boolean checkProgram​(byte[] program, java.util.List<byte[]> args) throws java.io.IOException
      Deprecated.
      Performs basic program validation: instruction count and program cost
      Parameters:
      program -
      args -
      Returns:
      Throws:
      java.io.IOException
    • readProgram

      public static Logic.ProgramData readProgram​(byte[] program, java.util.List<byte[]> args) throws java.io.IOException
      Deprecated.
      Performs basic program validation: instruction count and program cost
      Parameters:
      program - Program to validate
      args - Program arguments to validate
      Returns:
      boolean
      Throws:
      java.io.IOException
    • getLogicSigVersion

      public static int getLogicSigVersion() throws java.io.IOException
      Deprecated.
      Retrieves supported program version
      Returns:
      int
      Throws:
      java.io.IOException
    • getEvalMaxVersion

      public static int getEvalMaxVersion() throws java.io.IOException
      Deprecated.
      Retrieves max supported program version of evaluator
      Returns:
      int
      Throws:
      java.io.IOException
    • readIntConstBlock

      protected static Logic.IntConstBlock readIntConstBlock​(byte[] program, int pc)
      Deprecated.
    • readByteConstBlock

      protected static Logic.ByteConstBlock readByteConstBlock​(byte[] program, int pc)
      Deprecated.
    • readPushIntOp

      protected static Logic.IntConstBlock readPushIntOp​(byte[] program, int pc)
      Deprecated.
    • readPushByteOp

      protected static Logic.ByteConstBlock readPushByteOp​(byte[] program, int pc)
      Deprecated.