mesg-foundation/core

View on GitHub
x/execution/internal/types/msg.proto

Summary

Maintainability
Test Coverage
syntax = "proto3";

import "gogo/protobuf/gogoproto/gogo.proto";
import "protobuf/types/struct.proto";

package mesg.execution.types;
option go_package = "github.com/mesg-foundation/engine/x/execution/internal/types";

// The message to create an Execution.
message MsgCreate {
  // The msg's signer.
  bytes signer = 1 [
    (gogoproto.moretags) = 'validate:"required,accaddress"',
    (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
  ];

  // taskKey to filter executions.
  string taskKey = 2 [
    (gogoproto.moretags) = 'validate:"required,printascii"'
  ];

  mesg.protobuf.Struct inputs = 3;

  // tags the execution.
  repeated string tags = 4 [
    (gogoproto.moretags) = 'validate:"dive,printascii"'
  ];

  bytes parentHash = 5 [
    (gogoproto.moretags) = 'validate:"required_without=EventHash,omitempty,hash"',
    (gogoproto.casttype) = "github.com/mesg-foundation/engine/hash.Hash"
  ];

  bytes eventHash = 6 [
    (gogoproto.moretags) = 'validate:"required_without=ParentHash,omitempty,hash"',
    (gogoproto.casttype) = "github.com/mesg-foundation/engine/hash.Hash"
  ];

  bytes processHash = 7 [
    (gogoproto.moretags) = 'validate:"omitempty,hash"',
    (gogoproto.casttype) = "github.com/mesg-foundation/engine/hash.Hash"
  ];

  string nodeKey = 8;

  bytes executorHash = 9 [
    (gogoproto.moretags) = 'validate:"required,hash"',
    (gogoproto.casttype) = "github.com/mesg-foundation/engine/hash.Hash"
  ];
}

// The message to update an Execution.
message MsgUpdate {
  // The execution's executor.
  bytes executor = 1 [
    (gogoproto.moretags) = 'validate:"required,accaddress"',
    (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
  ];

  // Hash represents execution.
  bytes hash = 2 [
    (gogoproto.moretags) = 'validate:"required,hash"',
    (gogoproto.casttype) = "github.com/mesg-foundation/engine/hash.Hash"
  ];

  // result pass to execution
  oneof result {
    // outputs is a success result.
    mesg.protobuf.Struct outputs = 3;

    // error is an error result.
    string error = 4;
  }

  // Start time in nanoseconds.
  int64 start = 5 [
    (gogoproto.moretags) = 'validate:"required"'
  ];
  
  // Stop time in nanoseconds.
  int64 stop = 6 [
    (gogoproto.moretags) = 'validate:"required,gtfield=Start"'
  ];
}