From 6fe1b4fea5fbb145f32204a8574e8e8e4bfd6517 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Tue, 29 Sep 2020 20:01:45 +0200 Subject: [PATCH] send_nft() unit test --- contracts/cw721-base/src/contract.rs | 64 +++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/contracts/cw721-base/src/contract.rs b/contracts/cw721-base/src/contract.rs index e6bb5c4fd..4700f1504 100644 --- a/contracts/cw721-base/src/contract.rs +++ b/contracts/cw721-base/src/contract.rs @@ -465,7 +465,7 @@ fn humanize_approval(api: A, approval: &Approval) -> StdResult {} + e => panic!("unexpected error: {}", e), + } + + // but owner can + let random = mock_env("venus", &[]); + let res = handle(&mut deps, random, transfer_msg).unwrap(); + assert_eq!( + res, + HandleResponse { + messages: vec![msg], + log: vec![ + log("action", "send_nft"), + log("sender", "venus"), + log("recipient", "another_contract"), + log("token_id", token_id), + ], + data: None, + } + ); + } }