-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c7f603
commit 1c06b2e
Showing
56 changed files
with
2,626 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Only a simple implementation to not overload the tx builder | ||
use tonic::transport::Channel; | ||
|
||
use crate::{cosmos_query, queriers::DaemonQuerier, DaemonError}; | ||
|
||
/// Queries for Cosmos Bank Module | ||
pub struct Auth { | ||
channel: Channel, | ||
} | ||
|
||
impl DaemonQuerier for Auth { | ||
Check failure on line 11 in cw-orch-daemon/src/queriers/clients/auth.rs GitHub Actions / clippynot all trait items implemented, missing: `new`
|
||
fn new(channel: Channel) -> Self { | ||
Check failure on line 12 in cw-orch-daemon/src/queriers/clients/auth.rs GitHub Actions / clippymethod `new` has an incompatible type for trait
|
||
Self { channel } | ||
} | ||
} | ||
|
||
impl Auth { | ||
/// Query spendable balance for address | ||
pub async fn account(&self, address: impl Into<String>) -> Result<Vec<u8>, DaemonError> { | ||
|
||
|
||
let resp = cosmos_query!( | ||
Check failure on line 22 in cw-orch-daemon/src/queriers/clients/auth.rs GitHub Actions / clippy`cosmos_query` is ambiguous
|
||
self, | ||
auth, | ||
account, | ||
QueryAccountRequest { | ||
address: address.into() | ||
} | ||
); | ||
Ok(resp.account.unwrap().value) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/// macro for constructing and performing a query on a CosmosSDK module. | ||
#[macro_export] | ||
macro_rules! cosmos_query { | ||
Check failure on line 3 in cw-orch-daemon/src/queriers/grpc.rs GitHub Actions / clippythe name `cosmos_query` is defined multiple times
|
||
($self:ident, $module:ident, $func_name:ident, $request_type:ident { $($field:ident : $value:expr),* $(,)? }) => { | ||
{ | ||
use $crate::cosmos_modules::$module::{ | ||
query_client::QueryClient, $request_type, | ||
}; | ||
let mut client = QueryClient::new($self.channel.clone()); | ||
#[allow(clippy::redundant_field_names)] | ||
let request = $request_type { $($field : $value),* }; | ||
let response = client.$func_name(request.clone()).await?.into_inner(); | ||
::log::trace!( | ||
"cosmos_query: {:?} resulted in: {:?}", | ||
request, | ||
response | ||
); | ||
response | ||
} | ||
}; | ||
} |
File renamed without changes.
Oops, something went wrong.