Skip to content

Commit b66ab60

Browse files
authored
fix: allow empty grant if they're optional (#71)
1 parent d3a4f54 commit b66ab60

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

contracts/treasury/src/execute.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,12 @@ pub fn deploy_fee_grant(
277277
let response = QueryGrantsResponse::decode(authz_query_res.as_slice())?;
278278
let grants = response.grants;
279279

280-
if grants.clone().is_empty() && !grant_config.optional {
281-
return Err(AuthzGrantNotFound { msg_type_url });
280+
if grants.clone().is_empty() {
281+
if grant_config.optional {
282+
continue;
283+
} else {
284+
return Err(AuthzGrantNotFound { msg_type_url });
285+
}
282286
} else {
283287
match grants.first() {
284288
None => return Err(AuthzGrantNotFound { msg_type_url }),

0 commit comments

Comments
 (0)