Skip to content

Commit

Permalink
Add grpc balance method
Browse files Browse the repository at this point in the history
  • Loading branch information
keppel committed Oct 20, 2023
1 parent 93e95ea commit d383a68
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ibc/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use ibc_proto::cosmos::bank::v1beta1::{
QuerySpendableBalancesResponse, QuerySupplyOfRequest, QuerySupplyOfResponse,
QueryTotalSupplyRequest, QueryTotalSupplyResponse,
};
use ibc_proto::cosmos::base::v1beta1::Coin;
use ibc_proto::ibc::core::connection::v1::{
QueryConnectionParamsRequest, QueryConnectionParamsResponse,
};
Expand Down Expand Up @@ -748,9 +749,14 @@ pub struct BankService {}
impl BankQuery for BankService {
async fn balance(
&self,
_request: Request<QueryBalanceRequest>,
request: Request<QueryBalanceRequest>,
) -> Result<Response<QueryBalanceResponse>, Status> {
Ok(Response::new(QueryBalanceResponse { balance: None }))
Ok(Response::new(QueryBalanceResponse {
balance: Some(Coin {
amount: "0".to_string(),
denom: request.get_ref().denom.clone(),
}),
}))
}

async fn all_balances(
Expand Down

0 comments on commit d383a68

Please sign in to comment.