Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented 'keys add' and 'keys list' commmands #408

Merged
merged 30 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
31bd354
Added logic to generate GRPC client from cosmos.auth proto (#337)
andynog Nov 3, 2020
352a6d9
Adding logic to use GRPC client (#337)
andynog Nov 4, 2020
388c380
Grpc client connection retrieves account sequence (#337)
andynog Nov 4, 2020
57de7bc
Removed the account sequence flag from the tx raw commands (#337)
andynog Nov 4, 2020
3b54eb6
Removed instructions to query and specify account sequence from tx ra…
andynog Nov 4, 2020
49a787c
Logic to fetch GRPC endpoint address from config (#337)
andynog Nov 4, 2020
16776a6
Fixing tests (#361)
andynog Nov 5, 2020
15b46a1
Logic to use the address from the key seed (#337)
andynog Nov 5, 2020
0bf8230
Added boilerplate code for a keys add command to the relayer (#363)
andynog Nov 5, 2020
8ed590a
Merge branch 'andy/acct-sequence' into andy/add-key-cmd
andynog Nov 5, 2020
f1b2e50
Removing key flag from tx cmds
andynog Nov 6, 2020
833a200
Adding logic to get key specified in the config
andynog Nov 6, 2020
6a38918
Logic to get the key specified in the config (#363)
andynog Nov 6, 2020
164a130
Removed the -k flag from the tx raw commands (#363)
andynog Nov 6, 2020
3c89481
More logic to add key command (#363)
andynog Nov 11, 2020
1bc1046
key add command for memory store working (#363)
andynog Nov 11, 2020
f356a4d
Merging master into andy/add-key-cmd. Will re-implement changes lost …
andynog Nov 11, 2020
e60fa7c
Added logic to persist key seed in 'home' folder (#363)
andynog Nov 17, 2020
c45aa58
Changes implemented (#363):
andynog Nov 18, 2020
03e9880
Logic to use the key_name parameter from the config to add key. Remov…
andynog Nov 18, 2020
3eb5fd6
Changed the logic to get the key from the test keyring file store (#363)
andynog Nov 18, 2020
c695734
Implemented changes: (#363)
andynog Nov 19, 2020
6240317
Merging master and fixing merging conflicts. Merging fixed tx issues …
andynog Nov 19, 2020
4fcec4a
Updated the README instructions (#363)
andynog Nov 19, 2020
ce1aa53
Disable the 'keys restore' command for now (#363)
andynog Nov 19, 2020
cd1fd8b
Added 'keys list' command to show key added on a chain (#363)
andynog Nov 19, 2020
15eb796
Added entry for issue #363 (PR #408)
andynog Nov 19, 2020
f363896
Refactored the bound variables to use the full name per comment sugge…
andynog Nov 20, 2020
ac6e485
Merge branch 'master' into andy/add-key-cmd
ancazamfir Nov 23, 2020
d3ed4da
Move key retrieval, memo and timeout height inside send_tx
ancazamfir Nov 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Special thanks to external contributors for this release: @CharlyCst ([#347]).
- CLI for client update message ([#277])
- Implement the relayer CLI for connection handshake messages ([#358], [#359], [#360])
- Implement the relayer CLI for channel handshake messages ([#371], [#372], [#373], [#374])
- Implement commands to add and list keys for a chain ([#363])
- [proto-compiler]
- Refactor and allow specifying a commit at which the Cosmos SDK should be checked out ([#366])
- Add a `--tag` option to the `clone-sdk` command to check out a tag instead of a commit ([#369])
Expand All @@ -38,6 +39,7 @@ Special thanks to external contributors for this release: @CharlyCst ([#347]).
[#358]: https://github.com/informalsystems/ibc-rs/issues/358
[#358]: https://github.com/informalsystems/ibc-rs/issues/359
[#358]: https://github.com/informalsystems/ibc-rs/issues/360
[#363]: https://github.com/informalsystems/ibc-rs/issues/363
[#366]: https://github.com/informalsystems/ibc-rs/issues/366
[#368]: https://github.com/informalsystems/ibc-rs/issues/368
[#369]: https://github.com/informalsystems/ibc-rs/pulls/369
Expand Down
112 changes: 94 additions & 18 deletions proto/src/prost/cosmos.auth.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,138 @@
/// type for additional functionality (e.g. vesting).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BaseAccount {
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub address: std::string::String,
#[prost(message, optional, tag="2")]
#[prost(message, optional, tag = "2")]
pub pub_key: ::std::option::Option<::prost_types::Any>,
#[prost(uint64, tag="3")]
#[prost(uint64, tag = "3")]
pub account_number: u64,
#[prost(uint64, tag="4")]
#[prost(uint64, tag = "4")]
pub sequence: u64,
}
/// ModuleAccount defines an account for modules that holds coins on a pool.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModuleAccount {
#[prost(message, optional, tag="1")]
#[prost(message, optional, tag = "1")]
pub base_account: ::std::option::Option<BaseAccount>,
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub name: std::string::String,
#[prost(string, repeated, tag="3")]
#[prost(string, repeated, tag = "3")]
pub permissions: ::std::vec::Vec<std::string::String>,
}
/// Params defines the parameters for the auth module.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Params {
#[prost(uint64, tag="1")]
#[prost(uint64, tag = "1")]
pub max_memo_characters: u64,
#[prost(uint64, tag="2")]
#[prost(uint64, tag = "2")]
pub tx_sig_limit: u64,
#[prost(uint64, tag="3")]
#[prost(uint64, tag = "3")]
pub tx_size_cost_per_byte: u64,
#[prost(uint64, tag="4")]
#[prost(uint64, tag = "4")]
pub sig_verify_cost_ed25519: u64,
#[prost(uint64, tag="5")]
#[prost(uint64, tag = "5")]
pub sig_verify_cost_secp256k1: u64,
}
/// QueryAccountRequest is the request type for the Query/Account RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountRequest {
/// address defines the address to query for.
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub address: std::string::String,
}
/// QueryAccountResponse is the response type for the Query/Account RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountResponse {
/// account defines the account of the corresponding address.
#[prost(message, optional, tag="1")]
#[prost(message, optional, tag = "1")]
pub account: ::std::option::Option<::prost_types::Any>,
}
/// QueryParamsRequest is the request type for the Query/Params RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsRequest {
}
pub struct QueryParamsRequest {}
/// QueryParamsResponse is the response type for the Query/Params RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
/// params defines the parameters of the module.
#[prost(message, optional, tag="1")]
#[prost(message, optional, tag = "1")]
pub params: ::std::option::Option<Params>,
}
# [doc = r" Generated client implementations."] pub mod query_client { # ! [allow (unused_variables , dead_code , missing_docs)] use tonic :: codegen :: * ; # [doc = " Query defines the gRPC querier service."] pub struct QueryClient < T > { inner : tonic :: client :: Grpc < T > , } impl QueryClient < tonic :: transport :: Channel > { # [doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect < D > (dst : D) -> Result < Self , tonic :: transport :: Error > where D : std :: convert :: TryInto < tonic :: transport :: Endpoint > , D :: Error : Into < StdError > , { let conn = tonic :: transport :: Endpoint :: new (dst) ? . connect () . await ? ; Ok (Self :: new (conn)) } } impl < T > QueryClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new (inner : T) -> Self { let inner = tonic :: client :: Grpc :: new (inner) ; Self { inner } } pub fn with_interceptor (inner : T , interceptor : impl Into < tonic :: Interceptor >) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor (inner , interceptor) ; Self { inner } } # [doc = " Account returns account details based on address."] pub async fn account (& mut self , request : impl tonic :: IntoRequest < super :: QueryAccountRequest > ,) -> Result < tonic :: Response < super :: QueryAccountResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.auth.v1beta1.Query/Account") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Params queries all parameters."] pub async fn params (& mut self , request : impl tonic :: IntoRequest < super :: QueryParamsRequest > ,) -> Result < tonic :: Response < super :: QueryParamsResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.auth.v1beta1.Query/Params") ; self . inner . unary (request . into_request () , path , codec) . await } } impl < T : Clone > Clone for QueryClient < T > { fn clone (& self) -> Self { Self { inner : self . inner . clone () , } } } impl < T > std :: fmt :: Debug for QueryClient < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "QueryClient {{ ... }}") } } }
#[doc = r" Generated client implementations."]
pub mod query_client {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
#[doc = " Query defines the gRPC querier service."]
pub struct QueryClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QueryClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> QueryClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor(inner: T, interceptor: impl Into<tonic::Interceptor>) -> Self {
let inner = tonic::client::Grpc::with_interceptor(inner, interceptor);
Self { inner }
}
#[doc = " Account returns account details based on address."]
pub async fn account(
&mut self,
request: impl tonic::IntoRequest<super::QueryAccountRequest>,
) -> Result<tonic::Response<super::QueryAccountResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/Account");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Params queries all parameters."]
pub async fn params(
&mut self,
request: impl tonic::IntoRequest<super::QueryParamsRequest>,
) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/Params");
self.inner.unary(request.into_request(), path, codec).await
}
}
impl<T: Clone> Clone for QueryClient<T> {
fn clone(&self) -> Self {
Self {
inner: self.inner.clone(),
}
}
}
impl<T> std::fmt::Debug for QueryClient<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "QueryClient {{ ... }}")
}
}
}
70 changes: 35 additions & 35 deletions proto/src/prost/cosmos.base.abci.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,144 +3,144 @@
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxResponse {
/// The block height
#[prost(int64, tag="1")]
#[prost(int64, tag = "1")]
pub height: i64,
/// The transaction hash.
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub txhash: std::string::String,
/// Namespace for the Code
#[prost(string, tag="3")]
#[prost(string, tag = "3")]
pub codespace: std::string::String,
/// Response code.
#[prost(uint32, tag="4")]
#[prost(uint32, tag = "4")]
pub code: u32,
/// Result bytes, if any.
#[prost(string, tag="5")]
#[prost(string, tag = "5")]
pub data: std::string::String,
/// The output of the application's logger (raw string). May be
/// non-deterministic.
#[prost(string, tag="6")]
#[prost(string, tag = "6")]
pub raw_log: std::string::String,
/// The output of the application's logger (typed). May be non-deterministic.
#[prost(message, repeated, tag="7")]
#[prost(message, repeated, tag = "7")]
pub logs: ::std::vec::Vec<AbciMessageLog>,
/// Additional information. May be non-deterministic.
#[prost(string, tag="8")]
#[prost(string, tag = "8")]
pub info: std::string::String,
/// Amount of gas requested for transaction.
#[prost(int64, tag="9")]
#[prost(int64, tag = "9")]
pub gas_wanted: i64,
/// Amount of gas consumed by transaction.
#[prost(int64, tag="10")]
#[prost(int64, tag = "10")]
pub gas_used: i64,
/// The request transaction bytes.
#[prost(message, optional, tag="11")]
#[prost(message, optional, tag = "11")]
pub tx: ::std::option::Option<::prost_types::Any>,
/// Time of the previous block. For heights > 1, it's the weighted median of
/// the timestamps of the valid votes in the block.LastCommit. For height == 1,
/// it's genesis time.
#[prost(string, tag="12")]
#[prost(string, tag = "12")]
pub timestamp: std::string::String,
}
/// ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AbciMessageLog {
#[prost(uint32, tag="1")]
#[prost(uint32, tag = "1")]
pub msg_index: u32,
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub log: std::string::String,
/// Events contains a slice of Event objects that were emitted during some
/// execution.
#[prost(message, repeated, tag="3")]
#[prost(message, repeated, tag = "3")]
pub events: ::std::vec::Vec<StringEvent>,
}
/// StringEvent defines en Event object wrapper where all the attributes
/// contain key/value pairs that are strings instead of raw bytes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringEvent {
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub r#type: std::string::String,
#[prost(message, repeated, tag="2")]
#[prost(message, repeated, tag = "2")]
pub attributes: ::std::vec::Vec<Attribute>,
}
/// Attribute defines an attribute wrapper where the key and value are
/// strings instead of raw bytes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Attribute {
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub key: std::string::String,
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub value: std::string::String,
}
/// GasInfo defines tx execution gas context.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GasInfo {
/// GasWanted is the maximum units of work we allow this tx to perform.
#[prost(uint64, tag="1")]
#[prost(uint64, tag = "1")]
pub gas_wanted: u64,
/// GasUsed is the amount of gas actually consumed.
#[prost(uint64, tag="2")]
#[prost(uint64, tag = "2")]
pub gas_used: u64,
}
/// Result is the union of ResponseFormat and ResponseCheckTx.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Result {
/// Data is any data returned from message or handler execution. It MUST be
/// length prefixed in order to separate data from multiple message executions.
#[prost(bytes, tag="1")]
#[prost(bytes, tag = "1")]
pub data: std::vec::Vec<u8>,
/// Log contains the log information from message or handler execution.
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub log: std::string::String,
/// Events contains a slice of Event objects that were emitted during message
/// or handler execution.
#[prost(message, repeated, tag="3")]
#[prost(message, repeated, tag = "3")]
pub events: ::std::vec::Vec<::tendermint_proto::abci::Event>,
}
/// SimulationResponse defines the response generated when a transaction is
/// successfully simulated.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulationResponse {
#[prost(message, optional, tag="1")]
#[prost(message, optional, tag = "1")]
pub gas_info: ::std::option::Option<GasInfo>,
#[prost(message, optional, tag="2")]
#[prost(message, optional, tag = "2")]
pub result: ::std::option::Option<Result>,
}
/// MsgData defines the data returned in a Result object during message
/// execution.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgData {
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub msg_type: std::string::String,
#[prost(bytes, tag="2")]
#[prost(bytes, tag = "2")]
pub data: std::vec::Vec<u8>,
}
/// TxMsgData defines a list of MsgData. A transaction will have a MsgData object
/// for each message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxMsgData {
#[prost(message, repeated, tag="1")]
#[prost(message, repeated, tag = "1")]
pub data: ::std::vec::Vec<MsgData>,
}
/// SearchTxsResult defines a structure for querying txs pageable
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchTxsResult {
/// Count of all txs
#[prost(uint64, tag="1")]
#[prost(uint64, tag = "1")]
pub total_count: u64,
/// Count of txs in current page
#[prost(uint64, tag="2")]
#[prost(uint64, tag = "2")]
pub count: u64,
/// Index of current page, start from 1
#[prost(uint64, tag="3")]
#[prost(uint64, tag = "3")]
pub page_number: u64,
/// Count of total pages
#[prost(uint64, tag="4")]
#[prost(uint64, tag = "4")]
pub page_total: u64,
/// Max count txs per page
#[prost(uint64, tag="5")]
#[prost(uint64, tag = "5")]
pub limit: u64,
/// List of txs in current page
#[prost(message, repeated, tag="6")]
#[prost(message, repeated, tag = "6")]
pub txs: ::std::vec::Vec<TxResponse>,
}
6 changes: 3 additions & 3 deletions proto/src/prost/cosmos.base.kv.v1beta1.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/// Pairs defines a repeated slice of Pair objects.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Pairs {
#[prost(message, repeated, tag="1")]
#[prost(message, repeated, tag = "1")]
pub pairs: ::std::vec::Vec<Pair>,
}
/// Pair defines a key/value bytes tuple.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Pair {
#[prost(bytes, tag="1")]
#[prost(bytes, tag = "1")]
pub key: std::vec::Vec<u8>,
#[prost(bytes, tag="2")]
#[prost(bytes, tag = "2")]
pub value: std::vec::Vec<u8>,
}
Loading