Package org.stellar.sdk.xdr
Class HostFunction
java.lang.Object
org.stellar.sdk.xdr.HostFunction
HostFunction's original definition in the XDR file is:
union HostFunction switch (HostFunctionType type)
{
case HOST_FUNCTION_TYPE_INVOKE_CONTRACT:
InvokeContractArgs invokeContract;
case HOST_FUNCTION_TYPE_CREATE_CONTRACT:
CreateContractArgs createContract;
case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM:
opaque wasm<>;
case HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2:
CreateContractArgsV2 createContractV2;
};
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHostFunction(HostFunctionType discriminant, InvokeContractArgs invokeContract, CreateContractArgs createContract, byte[] wasm, CreateContractArgsV2 createContractV2) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static HostFunctiondecode(XdrDataInputStream stream) voidencode(XdrDataOutputStream stream) booleanstatic HostFunctionfromXdrBase64(String xdr) static HostFunctionfromXdrByteArray(byte[] xdr) byte[]getWasm()inthashCode()voidsetCreateContract(CreateContractArgs createContract) voidsetCreateContractV2(CreateContractArgsV2 createContractV2) voidsetDiscriminant(HostFunctionType discriminant) voidsetInvokeContract(InvokeContractArgs invokeContract) voidsetWasm(byte[] wasm) toString()default Stringdefault byte[]
-
Constructor Details
-
HostFunction
public HostFunction() -
HostFunction
public HostFunction(HostFunctionType discriminant, InvokeContractArgs invokeContract, CreateContractArgs createContract, byte[] wasm, CreateContractArgsV2 createContractV2)
-
-
Method Details
-
encode
- Throws:
IOException
-
decode
- Throws:
IOException
-
fromXdrBase64
- Throws:
IOException
-
fromXdrByteArray
- Throws:
IOException
-
builder
-
toBuilder
-
getDiscriminant
-
getInvokeContract
-
getCreateContract
-
getWasm
public byte[] getWasm() -
getCreateContractV2
-
setDiscriminant
-
setInvokeContract
-
setCreateContract
-
setWasm
public void setWasm(byte[] wasm) -
setCreateContractV2
-
equals
-
hashCode
public int hashCode() -
toString
-
toXdrBase64
- Throws:
IOException
-
toXdrByteArray
- Throws:
IOException
-