Skip to content

Commit

Permalink
Handshake impls from relayer loop (#421)
Browse files Browse the repository at this point in the history
* Added logic to generate GRPC client from cosmos.auth proto (#337)

* Adding logic to use GRPC client (#337)

* Grpc client connection retrieves account sequence (#337)

* Removed the account sequence flag from the tx raw commands (#337)

* Removed instructions to query and specify account sequence from tx raw command (#337)

* Logic to fetch GRPC endpoint address from config (#337)

* Fixing tests (#361)

* Logic to use the address from the key seed (#337)

* Added boilerplate code for a keys add command to the relayer (#363)

* Removing key flag from tx cmds

* Adding logic to get key specified in the config

* Logic to get the key specified in the config (#363)

* Removed the -k flag from the tx raw commands (#363)

* More logic to add key command (#363)

* key add command for memory store working (#363)

* Added logic to persist key seed in 'home' folder (#363)

* Changes implemented (#363):
- Added a new test keyring backend to support adding keys to file system (under home folder)
- Refactored logic to add key to be part of the keystore and not the command
- Switched the keybase on a chain to use the test keyring
- Key seed file is saved in the test keystore default folder (/home/andy/.rrly)

* Logic to use the key_name parameter from the config to add key. Removed name parameter from keys add cmd (#363)

* Changed the logic to get the key from the test keyring file store (#363)

* Implemented changes: (#363)
- Clean up remaining key_seed flag for tx cmds
- Refactored keybase to include chain config
- Refactoring keyring methods to use chain config
- Logic to use configured key to sign tx

* Updated the README instructions (#363)

* Disable the 'keys restore' command for now (#363)

* Added 'keys list' command to show key added on a chain (#363)

* Added entry for issue #363 (PR #408)

* Refactored the bound variables to use the full name per comment suggestion (#408)

* Move key retrieval, memo and timeout height inside send_tx

* Add the client creation, connection and channel handshake

* remove sleeps

* More error handling, cleanup

* Macro for channel CLIs

* Macro for connection CLIs

* Where src/dst make no sense rename to a/b, also fix a few bugs after last commits

* cleanup

* cargo fmt

* Use Romain's skip-verif until backwards verification is done

* fix CLI bugs

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
  • Loading branch information
ancazamfir and andynog authored Nov 27, 2020
1 parent a7d59da commit 2aa305b
Show file tree
Hide file tree
Showing 23 changed files with 1,844 additions and 1,907 deletions.
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ members = [
exclude = [
"proto-compiler"
]

[patch.crates-io]

tendermint = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/skip-verif" }
tendermint-rpc = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/skip-verif" }
tendermint-proto = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/skip-verif" }
tendermint-light-client = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/skip-verif" }
18 changes: 10 additions & 8 deletions modules/src/ics04_channel/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ impl ChannelEnd {
}
self.counterparty().validate_basic()
}

/// Helper function to compare the state of this end with another state.
pub fn state_matches(&self, other: &State) -> bool {
self.state.eq(other)
}
}

#[derive(Clone, Debug, PartialEq)]
Expand Down Expand Up @@ -236,18 +241,16 @@ impl FromStr for Order {

#[derive(Clone, Debug, PartialEq)]
pub enum State {
Uninitialized = 0,
Init,
TryOpen,
Open,
Closed,
Init = 1,
TryOpen = 2,
Open = 3,
Closed = 4,
}

impl State {
/// Yields the state as a string
pub fn as_string(&self) -> &'static str {
match self {
Self::Uninitialized => "UNINITIALIZED",
Self::Init => "INIT",
Self::TryOpen => "TRYOPEN",
Self::Open => "OPEN",
Expand All @@ -258,7 +261,6 @@ impl State {
// Parses the State out from a i32.
pub fn from_i32(s: i32) -> Result<Self, Error> {
match s {
0 => Ok(Self::Uninitialized),
1 => Ok(Self::Init),
2 => Ok(Self::TryOpen),
3 => Ok(Self::Open),
Expand Down Expand Up @@ -291,7 +293,7 @@ pub mod test_util {
/// Returns a dummy `RawChannel`, for testing only!
pub fn get_dummy_raw_channel_end() -> RawChannel {
RawChannel {
state: 0,
state: 1,
ordering: 0,
counterparty: Some(get_dummy_raw_counterparty()),
connection_hops: vec![],
Expand Down
Loading

0 comments on commit 2aa305b

Please sign in to comment.