decode static method

XdrHostFunction decode(
  1. XdrDataInputStream stream
)

Implementation

static XdrHostFunction decode(XdrDataInputStream stream) {
  XdrHostFunction decoded =
      XdrHostFunction(XdrHostFunctionType.decode(stream));
  switch (decoded.type) {
    case XdrHostFunctionType.HOST_FUNCTION_TYPE_INVOKE_CONTRACT:
      decoded.invokeContract = XdrInvokeContractArgs.decode(stream);
      break;
    case XdrHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT:
      decoded.createContract = XdrCreateContractArgs.decode(stream);
      break;
    case XdrHostFunctionType.HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM:
      decoded.wasm = XdrDataValue.decode(stream);
      break;
  }
  return decoded;
}