Skip to content

Commit

Permalink
binary converstion
Browse files Browse the repository at this point in the history
  • Loading branch information
ash-burnt committed Jun 4, 2024
1 parent 446fb85 commit 362a20b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions treasury/src/execute.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use crate::error::ContractError::{AuthzGrantMistmatch, AuthzGrantNoAuthorization, AuthzGrantNotFound, ConfigurationMismatch, Unauthorized};
use crate::error::ContractError::{
AuthzGrantMistmatch, AuthzGrantNoAuthorization, AuthzGrantNotFound, ConfigurationMismatch,
Unauthorized,
};
use crate::error::ContractResult;
use crate::grant::allowance::format_allowance;
use crate::grant::{Any, GrantConfig};
Expand Down Expand Up @@ -112,7 +115,7 @@ pub fn deploy_fee_grant(
deps.querier
.query::<QueryGrantsResponse>(&cosmwasm_std::QueryRequest::Stargate {
path: "/cosmos.authz.v1beta1.Query/Grants".to_string(),
data: query_msg.to_bytes().unwrap().into(),
data: cosmwasm_std::to_binary(&query_msg)?,
})?;
// grant queries with a granter, grantee and type_url should always result
// in only one result
Expand Down Expand Up @@ -142,10 +145,9 @@ pub fn deploy_fee_grant(
grantee: authz_grantee.into_string(),
allowance: Some(formatted_allowance.into()),
};
let feegrant_msg_bz = cosmwasm_std::to_binary(&feegrant_msg)?;
let cosmos_msg = CosmosMsg::Stargate {
type_url: "/cosmos.auth.v1beta1.Msg/MsgGrantAllowance".to_string(),
value: feegrant_msg_bz,
value: cosmwasm_std::to_binary(&feegrant_msg)?,
};
Ok(Response::new().add_message(cosmos_msg))
}
Expand Down

0 comments on commit 362a20b

Please sign in to comment.