syntax = "proto3";

import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "cosmossdk.io/x/tx/internal/testpb";

message SimpleSigner {
  option (cosmos.msg.v1.signer) = "signer";
  string signer                 = 1;
}

message RepeatedSigner {
  option (cosmos.msg.v1.signer) = "signer";
  repeated string signer        = 1;
}

message NestedSigner {
  option (cosmos.msg.v1.signer) = "inner";
  Inner inner                   = 1;

  message Inner {
    option (cosmos.msg.v1.signer) = "signer";
    string signer                 = 1;
  }
}

message RepeatedNestedSigner {
  option (cosmos.msg.v1.signer) = "inner";
  repeated Inner inner          = 1;

  message Inner {
    option (cosmos.msg.v1.signer) = "signer";
    string signer                 = 1;
  }
}

message NestedRepeatedSigner {
  option (cosmos.msg.v1.signer) = "inner";
  Inner inner                   = 1;

  message Inner {
    option (cosmos.msg.v1.signer) = "signer";
    repeated string signer        = 1;
  }
}

message RepeatedNestedRepeatedSigner {
  option (cosmos.msg.v1.signer) = "inner";
  repeated Inner inner          = 1;

  message Inner {
    option (cosmos.msg.v1.signer) = "signer";
    repeated string signer        = 1;
  }
}

message DeeplyNestedSigner {
  option (cosmos.msg.v1.signer) = "inner_one";
  InnerOne inner_one            = 1;

  message InnerOne {
    option (cosmos.msg.v1.signer) = "inner_two";
    InnerTwo inner_two            = 1;

    message InnerTwo {
      option (cosmos.msg.v1.signer) = "signer";
      string signer                 = 1;
    }
  }
}

message DeeplyNestedRepeatedSigner {
  option (cosmos.msg.v1.signer) = "inner";
  repeated Inner inner          = 1;

  message Inner {
    option (cosmos.msg.v1.signer) = "inner";
    repeated Inner inner          = 1;

    message Inner {
      option (cosmos.msg.v1.signer) = "inner";
      repeated Bottom inner         = 1;

      message Bottom {
        option (cosmos.msg.v1.signer) = "signer";
        repeated string signer        = 1;
      }
    }
  }
}

message BadSigner {
  option (cosmos.msg.v1.signer) = "signer";
  int32 signer                  = 1;
}

message NoSignerOption {
  bytes signer = 1;
}

message ValidatorSigner {
  option (cosmos.msg.v1.signer) = "signer";
  string signer                 = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"];
}

message ValidatorSigners {
  option (cosmos.msg.v1.signer) = "signers";
  repeated string signers       = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"];
}

message ValidatorByteSigner {
  option (cosmos.msg.v1.signer) = "signer";
  bytes signer                  = 1;
}

message ValidatorByteSigners {
  option (cosmos.msg.v1.signer) = "signers";
  repeated bytes signers        = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"];
}

service TestSimpleSigner {
  option (cosmos.msg.v1.service) = true;
  rpc TestSimpleSigner(SimpleSigner) returns (SimpleSigner) {}
}
