All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.scalar.dl.client.service.AbstractLedgerClient Maven / Gradle / Ivy

There is a newer version: 3.10.0
Show newest version
package com.scalar.dl.client.service;

import com.scalar.dl.ledger.database.TransactionState;
import com.scalar.dl.ledger.model.ContractExecutionResult;
import com.scalar.dl.ledger.model.LedgerValidationResult;
import com.scalar.dl.ledger.model.LedgersValidationResult;
import com.scalar.dl.ledger.proof.AssetProof;
import com.scalar.dl.ledger.service.ThrowableFunction;
import com.scalar.dl.rpc.AssetProofRetrievalRequest;
import com.scalar.dl.rpc.ContractExecutionRequest;
import com.scalar.dl.rpc.ContractExecutionResponse;
import com.scalar.dl.rpc.ExecutionAbortRequest;
import com.scalar.dl.rpc.FunctionRegistrationRequest;
import com.scalar.dl.rpc.LedgerValidationRequest;
import com.scalar.dl.rpc.LedgersValidationRequest;
import java.util.Optional;

public abstract class AbstractLedgerClient implements Client {
  protected static final ThrowableFunction
      DEFAULT_AUDITING_HOOK = r -> null;

  abstract void register(FunctionRegistrationRequest request);

  abstract ContractExecutionResult execute(ContractExecutionRequest request);

  abstract ContractExecutionResult execute(
      ContractExecutionRequest request,
      ThrowableFunction auditingHook);

  abstract LedgerValidationResult validate(LedgerValidationRequest request);

  abstract LedgersValidationResult validate(LedgersValidationRequest request);

  abstract Optional retrieve(AssetProofRetrievalRequest request);

  abstract TransactionState abort(ExecutionAbortRequest request);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy