cosmos / ibc-proto-rs

Rust Protobuf definitions and gRPC clients for interacting with Cosmos SDK, IBC and Interchain Security
Apache License 2.0
42 stars 25 forks source link

Extend `ibc::mock` types with more data fields #186

Closed rnbguy closed 5 months ago

rnbguy commented 6 months ago

We are going over some refactoring at ibc-rs to improve the ibc-testkit and existing tests.

During this, I realized that the current mock client types are too simple to test all IBC specifications. I want to extend the current mock client types as follows.

message Header {
  ibc.core.client.v1.Height height = 1;
  google.protobuf.Timestamp timestamp = 2;
}

message ClientState {
  Header header = 1;
  google.protobuf.Duration trusing_period = 2;
  google.protobuf.Duration max_clock_drift = 3;
  bool frozen = 4;
}

message ConsensusState {
  Header header = 1;
  bytes consensus_bytes = 2;
}

I add trusting_period and max_clock_drift as timestamp is already part of the Header. consensus_bytes and frozen fields are the main fields - that I require. They are needed to test merkle proofs and frozen clients.