Skip to content

Commit

Permalink
fix tests by adding nft_contract_id to args of changed calls
Browse files Browse the repository at this point in the history
  • Loading branch information
piakushin committed Oct 27, 2022
1 parent 08a740a commit 68810ab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Binary file modified dist/nft_benefits_vault.wasm
Binary file not shown.
3 changes: 3 additions & 0 deletions src/tests/environment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ impl Environment {

pub async fn check_deposit_to_vault(&self) -> Result<()> {
let args = to_vec(&json!({
"nft_contract_id": self.nft.id(),
"nft_id": NFT_TOKEN_ID,
}))?;
let res = self.vault.view(VAULT_VIEW_CALL, args).await?;
Expand All @@ -156,6 +157,7 @@ impl Environment {

pub async fn vault_balance_of(&self) -> Result<Option<BalanceView>> {
let args = to_vec(&json!({
"nft_contract_id": self.nft.id(),
"nft_id": NFT_TOKEN_ID,
}))?;
let res = self
Expand All @@ -169,6 +171,7 @@ impl Environment {

pub async fn withdraw_all(&self) -> Result<()> {
let args = json!({
"nft_contract_id": self.nft.id(),
"nft_id": NFT_TOKEN_ID,
});
let res = self
Expand Down
1 change: 1 addition & 0 deletions src/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async fn test_contract() -> Result<()> {
}

async fn check_vault_state(env: &Environment) -> Result<()> {
println!("nft_contract_id: {}", env.nft.id());
let balance = env.vault_balance_of().await?.unwrap();
assert_eq!(
balance
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./build.sh && cargo test -- --nocapture
./build.sh && cargo test -- $1

0 comments on commit 68810ab

Please sign in to comment.