syntax = "proto3";

package ibc.core.channel.v1;

option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types";

import "gogoproto/gogo.proto";
import "ibc/core/channel/v1/channel.proto";

// GenesisState defines the ibc channel submodule's genesis state.
message GenesisState {
  repeated IdentifiedChannel channels = 1 [(gogoproto.casttype) = "IdentifiedChannel", (gogoproto.nullable) = false];
  repeated PacketState       acknowledgements = 2 [(gogoproto.nullable) = false];
  repeated PacketState       commitments      = 3 [(gogoproto.nullable) = false];
  repeated PacketState       receipts         = 4 [(gogoproto.nullable) = false];
  repeated PacketSequence    send_sequences   = 5
      [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"send_sequences\""];
  repeated PacketSequence recv_sequences = 6
      [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"recv_sequences\""];
  repeated PacketSequence ack_sequences = 7
      [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ack_sequences\""];
  // the sequence for the next generated channel identifier
  uint64 next_channel_sequence = 8 [(gogoproto.moretags) = "yaml:\"next_channel_sequence\""];
}

// PacketSequence defines the genesis type necessary to retrieve and store
// next send and receive sequences.
message PacketSequence {
  string port_id    = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
  string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
  uint64 sequence   = 3;
}
