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.mdStringResultWrapper
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 contractCodeStringResultWrapper
blockingCompile(java.lang.String contractCode, java.util.Map<java.lang.String,java.lang.String> fileSystem)
synchronously gets the contract bytecode for this contractCodeObjectResultWrapper
blockingDecodeCalldata(java.lang.String calldata, java.lang.String sophiaType)
synchronously decodes a calldataObjectResultWrapper
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-callsStringResultWrapper
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 contractCodeACIResult
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.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:CompilerService
asynchronously gets the encoded calldata for this contractCode- Specified by:
asyncEncodeCalldata
in 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:CompilerService
synchronously gets the encoded calldata for this contractCode- Specified by:
blockingEncodeCalldata
in 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:CompilerService
asynchronously gets the contract bytecode for this contractCode- Specified by:
asyncCompile
in 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:CompilerService
asynchronously decodes a calldata- Specified by:
asyncDecodeCalldata
in 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:CompilerService
synchronously decodes a calldata- Specified by:
blockingDecodeCalldata
in 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:CompilerService
asynchronously decodes callresult of contract-calls- Specified by:
asyncDecodeCallResult
in 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:CompilerService
synchronously decodes callresult of contract-calls- Specified by:
blockingDecodeCallResult
in 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:CompilerService
asynchronously generates the ACI for this contractCode https://github.com/aeternity/aesophia/blob/master/docs/aeso_aci.md- Specified by:
asyncGenerateACI
in 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:CompilerService
synchronously generates the ACI for this contractCode https://github.com/aeternity/aesophia/blob/master/docs/aeso_aci.md- Specified by:
blockingGenerateACI
in 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:CompilerService
asynchronously gets the contract bytecode for this contractCode- Specified by:
asyncCompile
in 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:CompilerService
synchronously gets the contract bytecode for this contractCode- Specified by:
blockingCompile
in 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:CompilerService
synchronously gets the contract bytecode for this contractCode- Specified by:
blockingCompile
in 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
-