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 contractCodeio.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 contractCodeio.reactivex.Single<ObjectResultWrapper>asyncDecodeCalldata(java.lang.String calldata, java.lang.String sophiaType)asynchronously decodes a calldataio.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-callsio.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 contractCodeio.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.mdStringResultWrapperblockingCompile(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 contractCodeStringResultWrapperblockingCompile(java.lang.String contractCode, java.util.Map<java.lang.String,java.lang.String> fileSystem)synchronously gets the contract bytecode for this contractCodeObjectResultWrapperblockingDecodeCalldata(java.lang.String calldata, java.lang.String sophiaType)synchronously decodes a calldataObjectResultWrapperblockingDecodeCallResult(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-callsStringResultWrapperblockingEncodeCalldata(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 contractCodeACIResultblockingGenerateACI(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.mdMethods 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:CompilerServiceasynchronously gets the encoded calldata for this contractCode- Specified by:
asyncEncodeCalldatain interfaceCompilerService- Parameters:
sourceCode- the sourcecode of the contractfunction- the name of the function to callarguments- the params that should be passed to the functionfileSystem- 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:CompilerServicesynchronously gets the encoded calldata for this contractCode- Specified by:
blockingEncodeCalldatain interfaceCompilerService- Parameters:
sourceCode- the sourcecode of the contractfunction- the name of the function to callarguments- the params that should be passed to the functionfileSystem- 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:CompilerServiceasynchronously gets the contract bytecode for this contractCode- Specified by:
asyncCompilein interfaceCompilerService- Parameters:
contractCode- the sourcecode of the contractfileSystem- 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:CompilerServiceasynchronously decodes a calldata- Specified by:
asyncDecodeCalldatain interfaceCompilerService- Parameters:
calldata- the calldatasophiaType- 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:CompilerServicesynchronously decodes a calldata- Specified by:
blockingDecodeCalldatain interfaceCompilerService- Parameters:
calldata- the calldatasophiaType- 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:CompilerServiceasynchronously decodes callresult of contract-calls- Specified by:
asyncDecodeCallResultin interfaceCompilerService- Parameters:
source- the contract sourcefunction- the called functioncallResult- the received resultType (ok | error | revert)callValue- the received valuefileSystem- 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:CompilerServicesynchronously decodes callresult of contract-calls- Specified by:
blockingDecodeCallResultin interfaceCompilerService- Parameters:
source- the contract sourcefunction- the called functioncallResult- the received resultType (ok | error | revert)callValue- the received valuefileSystem- 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:CompilerServiceasynchronously generates the ACI for this contractCode https://github.com/aeternity/aesophia/blob/master/docs/aeso_aci.md- Specified by:
asyncGenerateACIin interfaceCompilerService- Parameters:
contractCode- the sourcecode of the contractsrcFile- untested compileOpts value: set nullfileSystem- 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:CompilerServicesynchronously generates the ACI for this contractCode https://github.com/aeternity/aesophia/blob/master/docs/aeso_aci.md- Specified by:
blockingGenerateACIin interfaceCompilerService- Parameters:
contractCode- the sourcecode of the contractsrcFile- untested compileOpts value: set nullfileSystem- 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:CompilerServiceasynchronously gets the contract bytecode for this contractCode- Specified by:
asyncCompilein interfaceCompilerService- Parameters:
contractCode- the sourcecode of the contractsrcFile- untested compileOpts value: set nullfileSystem- 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:CompilerServicesynchronously gets the contract bytecode for this contractCode- Specified by:
blockingCompilein interfaceCompilerService- Parameters:
contractCode- the sourcecode of the contractfileSystem- 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:CompilerServicesynchronously gets the contract bytecode for this contractCode- Specified by:
blockingCompilein interfaceCompilerService- Parameters:
contractCode- the sourcecode of the contractsrcFile- untested compileOpts value: set nullfileSystem- map with libraryName and code which is passed to the compiler- Returns:
- byteCode of the compiled contract
-