-
Notifications
You must be signed in to change notification settings - Fork 26
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
Showing
7 changed files
with
84 additions
and
27 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 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,48 @@ | ||
use crate::{ | ||
msg::QueryMsg, | ||
utils::{ExchangeType, Setup}, | ||
}; | ||
|
||
use crate::utils::create_generic_authorization; | ||
use injective_cosmwasm::authz::response::GrantsResponse; | ||
use injective_test_tube::injective_cosmwasm::authz::response::GranteeGrantsResponse; | ||
use injective_test_tube::{Account, Module, RunnerResult, Wasm}; | ||
|
||
#[test] | ||
#[cfg_attr(not(feature = "integration"), ignore)] | ||
fn test_query_grants() { | ||
let env = Setup::new(ExchangeType::None); | ||
let wasm = Wasm::new(&env.app); | ||
|
||
let msg_type_url = "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder".to_string(); | ||
let granter = &env.users[0].account; | ||
let grantee = env.contract_address.clone(); | ||
|
||
create_generic_authorization(&env.app, granter, grantee.to_owned(), msg_type_url.to_owned(), None); | ||
|
||
let query_msg = QueryMsg::TestQueryGrants { | ||
grantee, | ||
granter: granter.address(), | ||
msg_type_url, | ||
pagination: None, | ||
}; | ||
let _res: RunnerResult<GrantsResponse> = wasm.query(&env.contract_address, &query_msg); | ||
//todo fix query | ||
} | ||
|
||
#[test] | ||
#[cfg_attr(not(feature = "integration"), ignore)] | ||
fn test_query_grantee_grants() { | ||
let env = Setup::new(ExchangeType::None); | ||
let wasm = Wasm::new(&env.app); | ||
|
||
let msg_type_url = "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder".to_string(); | ||
let granter = &env.users[0].account; | ||
let grantee = env.contract_address.clone(); | ||
|
||
create_generic_authorization(&env.app, granter, grantee.to_owned(), msg_type_url.to_owned(), None); | ||
|
||
let query_msg = QueryMsg::TestGranteeGrants { grantee, pagination: None }; | ||
let _res: RunnerResult<GranteeGrantsResponse> = wasm.query(&env.contract_address, &query_msg); | ||
//todo fix query | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
mod authz; | ||
mod query_exchange_derivative_tests; | ||
mod query_exchange_tests; |
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