Skip to content

Commit

Permalink
Improve test coverage again
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Hartnell committed Aug 19, 2023
1 parent 0a47b53 commit 3bfaac7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/cw-hooks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ mod tests {
let mut deps = mock_dependencies();
let storage = &mut deps.storage;
let hooks = Hooks::new("hooks");

// Prepare hooks doesn't through error if no hooks added
let msgs = hooks
.prepare_hooks(storage, |a| {
Ok(SubMsg::reply_always(
BankMsg::Burn {
amount: coins(a.as_str().len() as u128, "uekez"),
},
2,
))
})
.unwrap();
assert_eq!(msgs, vec![]);

hooks.add_hook(storage, addr!("ekez")).unwrap();
hooks.add_hook(storage, addr!("meow")).unwrap();

Expand Down

0 comments on commit 3bfaac7

Please sign in to comment.