-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update aggregate verifier tests to utilize contract trait (#…
…274)
- Loading branch information
Showing
4 changed files
with
90 additions
and
90 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use aggregate_verifier::{ | ||
contract::*, | ||
msg::{ExecuteMsg, InstantiateMsg, QueryMsg}, | ||
}; | ||
use cosmwasm_std::Addr; | ||
use cw_multi_test::{App, ContractWrapper, Executor}; | ||
use integration_tests::contract::Contract; | ||
|
||
pub struct AggregateVerifierContract { | ||
pub contract_addr: Addr, | ||
} | ||
|
||
impl AggregateVerifierContract { | ||
pub fn instantiate_contract(app: &mut App, voting_verifier_address: Addr) -> Self { | ||
let code = ContractWrapper::new(execute, instantiate, query).with_reply(reply); | ||
let code_id = app.store_code(Box::new(code)); | ||
|
||
let contract_addr = app | ||
.instantiate_contract( | ||
code_id, | ||
Addr::unchecked("gateway"), | ||
&InstantiateMsg { | ||
verifier_address: voting_verifier_address.to_string(), | ||
}, | ||
&[], | ||
"Contract", | ||
None, | ||
) | ||
.unwrap(); | ||
|
||
AggregateVerifierContract { contract_addr } | ||
} | ||
} | ||
|
||
impl Contract for AggregateVerifierContract { | ||
type QMsg = QueryMsg; | ||
type ExMsg = ExecuteMsg; | ||
|
||
fn contract_address(&self) -> Addr { | ||
self.contract_addr.clone() | ||
} | ||
} |