Class SophiaCompilerServiceImpl

java.lang.Object
com.kryptokrauts.aeternity.sdk.service.compiler.impl.SophiaCompilerServiceImpl
All Implemented Interfaces:
CompilerService

public final class SophiaCompilerServiceImpl
extends java.lang.Object
implements CompilerService
  • Constructor Summary

    Constructors
    Constructor Description
    SophiaCompilerServiceImpl()  
  • Method Summary

    Modifier and Type Method Description
    io.reactivex.Single<StringResultWrapper> asyncCompile​(java.lang.String contractCode, java.lang.String srcFile, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    asynchronously gets the contract bytecode for this contractCode
    io.reactivex.Single<StringResultWrapper> asyncCompile​(java.lang.String contractCode, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    asynchronously gets the contract bytecode for this contractCode
    io.reactivex.Single<ObjectResultWrapper> asyncDecodeCalldata​(java.lang.String calldata, java.lang.String sophiaType)
    asynchronously decodes a calldata
    io.reactivex.Single<ObjectResultWrapper> asyncDecodeCallResult​(java.lang.String source, java.lang.String function, java.lang.String callResult, java.lang.String callValue, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    asynchronously decodes callresult of contract-calls
    io.reactivex.Single<StringResultWrapper> asyncEncodeCalldata​(java.lang.String sourceCode, java.lang.String function, java.util.List<java.lang.String> arguments, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    asynchronously gets the encoded calldata for this contractCode
    io.reactivex.Single<ACIResult> asyncGenerateACI​(java.lang.String contractCode, java.lang.String srcFile, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    asynchronously generates the ACI for this contractCode https://github.com/aeternity/aesophia/blob/master/docs/aeso_aci.md
    StringResultWrapper blockingCompile​(java.lang.String contractCode, java.lang.String srcFile, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    synchronously gets the contract bytecode for this contractCode
    StringResultWrapper blockingCompile​(java.lang.String contractCode, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    synchronously gets the contract bytecode for this contractCode
    ObjectResultWrapper blockingDecodeCalldata​(java.lang.String calldata, java.lang.String sophiaType)
    synchronously decodes a calldata
    ObjectResultWrapper blockingDecodeCallResult​(java.lang.String source, java.lang.String function, java.lang.String callResult, java.lang.String callValue, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    synchronously decodes callresult of contract-calls
    StringResultWrapper blockingEncodeCalldata​(java.lang.String sourceCode, java.lang.String function, java.util.List<java.lang.String> arguments, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    synchronously gets the encoded calldata for this contractCode
    ACIResult blockingGenerateACI​(java.lang.String contractCode, java.lang.String srcFile, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
    synchronously generates the ACI for this contractCode https://github.com/aeternity/aesophia/blob/master/docs/aeso_aci.md

    Methods inherited from class java.lang.Object

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

    • SophiaCompilerServiceImpl

      public SophiaCompilerServiceImpl()
  • Method Details

    • asyncEncodeCalldata

      public io.reactivex.Single<StringResultWrapper> asyncEncodeCalldata​(java.lang.String sourceCode, java.lang.String function, java.util.List<java.lang.String> arguments, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      asynchronously gets the encoded calldata for this contractCode
      Specified by:
      asyncEncodeCalldata in interface CompilerService
      Parameters:
      sourceCode - the sourcecode of the contract
      function - the name of the function to call
      arguments - the params that should be passed to the function
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      asynchronous result handler (RxJava Single) for encoded calldata
    • blockingEncodeCalldata

      public StringResultWrapper blockingEncodeCalldata​(java.lang.String sourceCode, java.lang.String function, java.util.List<java.lang.String> arguments, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      synchronously gets the encoded calldata for this contractCode
      Specified by:
      blockingEncodeCalldata in interface CompilerService
      Parameters:
      sourceCode - the sourcecode of the contract
      function - the name of the function to call
      arguments - the params that should be passed to the function
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      encoded calldata
    • asyncCompile

      public io.reactivex.Single<StringResultWrapper> asyncCompile​(java.lang.String contractCode, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      asynchronously gets the contract bytecode for this contractCode
      Specified by:
      asyncCompile in interface CompilerService
      Parameters:
      contractCode - the sourcecode of the contract
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      asynchronous result handler (RxJava Single) for byteCode of the compiled contract
    • asyncDecodeCalldata

      public io.reactivex.Single<ObjectResultWrapper> asyncDecodeCalldata​(java.lang.String calldata, java.lang.String sophiaType)
      Description copied from interface: CompilerService
      asynchronously decodes a calldata
      Specified by:
      asyncDecodeCalldata in interface CompilerService
      Parameters:
      calldata - the calldata
      sophiaType - the awaited sophia type
      Returns:
      asynchronous result handler (RxJava Single) for decoded answer as json string
    • blockingDecodeCalldata

      public ObjectResultWrapper blockingDecodeCalldata​(java.lang.String calldata, java.lang.String sophiaType)
      Description copied from interface: CompilerService
      synchronously decodes a calldata
      Specified by:
      blockingDecodeCalldata in interface CompilerService
      Parameters:
      calldata - the calldata
      sophiaType - the awaited sophia type
      Returns:
      decoded answer as json string
    • asyncDecodeCallResult

      public io.reactivex.Single<ObjectResultWrapper> asyncDecodeCallResult​(java.lang.String source, java.lang.String function, java.lang.String callResult, java.lang.String callValue, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      asynchronously decodes callresult of contract-calls
      Specified by:
      asyncDecodeCallResult in interface CompilerService
      Parameters:
      source - the contract source
      function - the called function
      callResult - the received resultType (ok | error | revert)
      callValue - the received value
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      the decoded sophia call result
    • blockingDecodeCallResult

      public ObjectResultWrapper blockingDecodeCallResult​(java.lang.String source, java.lang.String function, java.lang.String callResult, java.lang.String callValue, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      synchronously decodes callresult of contract-calls
      Specified by:
      blockingDecodeCallResult in interface CompilerService
      Parameters:
      source - the contract source
      function - the called function
      callResult - the received resultType (ok | error | revert)
      callValue - the received value
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      the decoded sophia call result
    • asyncGenerateACI

      public io.reactivex.Single<ACIResult> asyncGenerateACI​(java.lang.String contractCode, java.lang.String srcFile, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      asynchronously generates the ACI for this contractCode https://github.com/aeternity/aesophia/blob/master/docs/aeso_aci.md
      Specified by:
      asyncGenerateACI in interface CompilerService
      Parameters:
      contractCode - the sourcecode of the contract
      srcFile - untested compileOpts value: set null
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      asynchronous result handler (RxJava Single) for ACIResult
    • blockingGenerateACI

      public ACIResult blockingGenerateACI​(java.lang.String contractCode, java.lang.String srcFile, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      synchronously generates the ACI for this contractCode https://github.com/aeternity/aesophia/blob/master/docs/aeso_aci.md
      Specified by:
      blockingGenerateACI in interface CompilerService
      Parameters:
      contractCode - the sourcecode of the contract
      srcFile - untested compileOpts value: set null
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      result of ACIResult
    • asyncCompile

      public io.reactivex.Single<StringResultWrapper> asyncCompile​(java.lang.String contractCode, java.lang.String srcFile, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      asynchronously gets the contract bytecode for this contractCode
      Specified by:
      asyncCompile in interface CompilerService
      Parameters:
      contractCode - the sourcecode of the contract
      srcFile - untested compileOpts value: set null
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      asynchronous result handler (RxJava Single) for byteCode of the compiled contract
    • blockingCompile

      public StringResultWrapper blockingCompile​(java.lang.String contractCode, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      synchronously gets the contract bytecode for this contractCode
      Specified by:
      blockingCompile in interface CompilerService
      Parameters:
      contractCode - the sourcecode of the contract
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      byteCode of the compiled contract
    • blockingCompile

      public StringResultWrapper blockingCompile​(java.lang.String contractCode, java.lang.String srcFile, java.util.Map<java.lang.String,​java.lang.String> fileSystem)
      Description copied from interface: CompilerService
      synchronously gets the contract bytecode for this contractCode
      Specified by:
      blockingCompile in interface CompilerService
      Parameters:
      contractCode - the sourcecode of the contract
      srcFile - untested compileOpts value: set null
      fileSystem - map with libraryName and code which is passed to the compiler
      Returns:
      byteCode of the compiled contract