Interface VerifiedJar


  • public interface VerifiedJar
    A jar that has undergone static verification, before being installed into blockchain.
    • Method Detail

      • of

        static VerifiedJar of​(byte[] jar,
                              TakamakaClassLoader classLoader,
                              boolean duringInitialization,
                              boolean allowSelfCharged,
                              boolean skipsVerification)
                       throws IOException
        Creates a verified jar from the given file. This verification might fail if at least a class did not verify. In that case, the issues generated during verification will contain at least an error.
        Parameters:
        jar - the jar file to verify, given as an array of bytes
        classLoader - the class loader that can be used to resolve the classes of the program, including those of origin
        duringInitialization - true if and only if verification occurs during the initialization of the node
        allowSelfCharged - true if and only if @@SelfCharged methods are allowed
        skipsVerification - true if and only if the static verification of the classes of the jar must be skipped
        Throws:
        IOException - if there was a problem accessing the classes on disk
      • hasErrors

        boolean hasErrors()
        Determines if the verification of at least one class of the jar failed with an error.
        Returns:
        true if and only if that condition holds
      • getFirstError

        Optional<Error> getFirstError()
        Yields the first error (hence not a warning) that occurred during the verification of the origin jar.
      • classes

        Stream<VerifiedClass> classes()
        Yields the stream of the classes of the jar that passed verification.
        Returns:
        the classes, in increasing order
      • issues

        Stream<Issue> issues()
        Yields the issues generated during the verification of the classes of the jar.
        Returns:
        the issues, in increasing order
      • getClassLoader

        TakamakaClassLoader getClassLoader()
        Yields the class loader used to load this jar.
        Returns:
        the class loader
      • getAnnotations

        Annotations getAnnotations()
        Yields the utility object that can be used to check the annotations in the methods in this jar.
        Returns:
        the utility object
      • getBcelToClass

        BcelToClass getBcelToClass()
        Yields the utility object that can be used to transform BCEL types into their corresponding Java class tag, by using the class loader of this jar.
        Returns:
        the utility object