syntax = "proto3";
package provenance.metadata.v1.p8e;

option go_package = "github.com/provenance-io/provenance/x/metadata/types/p8e";

option java_package        = "io.provenance.metadata.v1.p8e";
option java_multiple_files = true;

// This stuff has been deprecated and is no longer usable.
// This contents of this file still exist for backwards compatibility (e.g. reading old transactions).

// Deprecated: Do not use.
message Contract {
  option                         deprecated     = true;
  DefinitionSpec                 definition     = 1;
  Fact                           spec           = 2;
  SigningAndEncryptionPublicKeys invoker        = 3;
  repeated Fact                  inputs         = 4;
  repeated Condition             conditions     = 5 [deprecated = true];
  repeated Consideration         considerations = 6;
  repeated Recital               recitals       = 7;
  int32                          times_executed = 8;
  Timestamp                      start_time     = 9;
  bytes                          context        = 10;
}

// Deprecated: Do not use.
message DefinitionSpec {
  option             deprecated        = true;
  string             name              = 1;
  Location           resource_location = 2;
  Signature          signature         = 3;
  DefinitionSpecType type              = 4;
}

// Deprecated: Do not use.
message Fact {
  option   deprecated    = true;
  string   name          = 1;
  Location data_location = 2;
}

// Deprecated: Do not use.
message Condition {
  option          deprecated     = true;
  string          condition_name = 1;
  ExecutionResult result         = 2;
}

// Deprecated: Do not use.
message Consideration {
  option                deprecated         = true;
  string                consideration_name = 1;
  repeated ProposedFact inputs             = 2;
  ExecutionResult       result             = 3;
}

// Deprecated: Do not use.
message ProposedFact {
  option              deprecated = true;
  string              name       = 1;
  string              hash       = 2;
  string              classname  = 3;
  ProvenanceReference ancestor   = 4;
}

// Deprecated: Do not use.
message ExecutionResult {
  option              deprecated    = true;
  ProposedFact        output        = 1;
  ExecutionResultType result        = 2;
  Timestamp           recorded_at   = 3;
  string              error_message = 4;
}

// Deprecated: Do not use.
message Recitals {
  option           deprecated = true;
  repeated Recital parties    = 1;
}

// Deprecated: Do not use.
message Recital {
  option                         deprecated  = true;
  PartyType                      signer_role = 1;
  SigningAndEncryptionPublicKeys signer      = 2;
  bytes                          address     = 3;
}

// Deprecated: Do not use.
message Location {
  option              deprecated = true;
  ProvenanceReference ref        = 1;
  string              classname  = 2;
}

// Deprecated: Do not use.
message ProvenanceReference {
  option deprecated = true;
  UUID   scope_uuid = 1;
  UUID   group_uuid = 2;
  string hash       = 3;
  string name       = 4;
}

// Deprecated: Do not use.
message SignatureSet {
  option             deprecated = true;
  repeated Signature signatures = 1;
}

// Deprecated: Do not use.
message Signature {
  option                         deprecated = true;
  string                         algo       = 1;
  string                         provider   = 2;
  string                         signature  = 3;
  SigningAndEncryptionPublicKeys signer     = 4;
}

// Deprecated: Do not use.
message SigningAndEncryptionPublicKeys {
  option    deprecated            = true;
  PublicKey signing_public_key    = 1;
  PublicKey encryption_public_key = 2;
}

// Deprecated: Do not use.
message PublicKey {
  option         deprecated       = true;
  bytes          public_key_bytes = 1;
  PublicKeyType  type             = 2;
  PublicKeyCurve curve            = 3;
}

// Deprecated: Do not use.
message UUID {
  option deprecated = true;
  string value      = 1;
}

// Deprecated: Do not use.
enum DefinitionSpecType {
  option deprecated = true;
  // Deprecated: Do not use.
  DEFINITION_SPEC_TYPE_UNKNOWN = 0;
  // Deprecated: Do not use.
  DEFINITION_SPEC_TYPE_PROPOSED = 1;
  // Deprecated: Do not use.
  DEFINITION_SPEC_TYPE_FACT = 2;
  // Deprecated: Do not use.
  DEFINITION_SPEC_TYPE_FACT_LIST = 3;
}

// Deprecated: Do not use.
enum PublicKeyCurve {
  option deprecated = true;
  // Deprecated: Do not use.
  SECP256K1 = 0;
  // Deprecated: Do not use.
  P256 = 1;
}

// Deprecated: Do not use.
enum PublicKeyType {
  option deprecated = true;
  // Deprecated: Do not use.
  ELLIPTIC = 0;
}

// Deprecated: Do not use.
enum ExecutionResultType {
  option deprecated = true;
  // Deprecated: Do not use.
  RESULT_TYPE_UNKNOWN = 0;
  // Deprecated: Do not use.
  RESULT_TYPE_PASS = 1;
  // Deprecated: Do not use.
  RESULT_TYPE_SKIP = 2;
  // Deprecated: Do not use.
  RESULT_TYPE_FAIL = 3;
}

// Deprecated: Do not use.
enum PartyType {
  option deprecated = true;
  // Deprecated: Do not use.
  PARTY_TYPE_UNKNOWN = 0;
  // Deprecated: Do not use.
  PARTY_TYPE_ORIGINATOR = 1;
  // Deprecated: Do not use.
  PARTY_TYPE_SERVICER = 2;
  // Deprecated: Do not use.
  PARTY_TYPE_INVESTOR = 3;
  // Deprecated: Do not use.
  PARTY_TYPE_CUSTODIAN = 4;
  // Deprecated: Do not use.
  PARTY_TYPE_OWNER = 5;
  // Deprecated: Do not use.
  PARTY_TYPE_AFFILIATE = 6;
  // Deprecated: Do not use.
  PARTY_TYPE_OMNIBUS = 7;
  // Deprecated: Do not use.
  PARTY_TYPE_PROVENANCE = 8;
  // Deprecated: Do not use.
  PARTY_TYPE_MARKER = 9;
  // Deprecated: Do not use.
  PARTY_TYPE_CONTROLLER = 10;
  // Deprecated: Do not use.
  PARTY_TYPE_VALIDATOR = 11;
}

// Copied from google/protobuf/timestamp.proto into here because using that version results in generated code looking
// for methods that don't exist: MarshalToSizedBuffer, Size, and Unmarshal.

// Deprecated: Do not use.
message Timestamp {
  option deprecated = true;
  int64  seconds    = 1;
  int32  nanos      = 2;
}

// Deprecated: Do not use.
message ContractSpec {
  option                     deprecated          = true;
  DefinitionSpec             definition          = 1;
  repeated DefinitionSpec    input_specs         = 2;
  repeated PartyType         parties_involved    = 3;
  repeated ConditionSpec     condition_specs     = 4;
  repeated ConsiderationSpec consideration_specs = 5;
}

// Deprecated: Do not use.
message ConditionSpec {
  option                  deprecated  = true;
  string                  func_name   = 1;
  repeated DefinitionSpec input_specs = 2;
  OutputSpec              output_spec = 3;
}

// Deprecated: Do not use.
message ConsiderationSpec {
  option                  deprecated        = true;
  string                  func_name         = 1;
  PartyType               responsible_party = 2;
  repeated DefinitionSpec input_specs       = 3;
  OutputSpec              output_spec       = 4;
}

// Deprecated: Do not use.
message OutputSpec {
  option         deprecated = true;
  DefinitionSpec spec       = 1;
}