Skip to content

Commit

Permalink
Test what events sent to reply
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Aug 9, 2021
1 parent c5b9870 commit 5c325a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/multi-test/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ mod test {
let res = app
.execute_contract(random.clone(), reflect_addr.clone(), &msgs, &[])
.unwrap();

// expected events: execute, transfer, reply, custom wasm (set in reply)
assert_eq!(4, res.events.len(), "{:?}", res.events);
let first = &res.events[0];
Expand Down Expand Up @@ -744,7 +745,10 @@ mod test {
// ensure success was written
let res: Reply = app.wrap().query_wasm_smart(&reflect_addr, &query).unwrap();
assert_eq!(res.id, 123);
assert!(res.result.is_ok());
// validate the events written in the reply blob...should just be bank transfer
let reply_events = res.result.unwrap().events;
assert_eq!(1, reply_events.len());
assert_eq!("transfer", &reply_events[0].ty);

// reflect sends 300 btc, failure, but error caught by submessage (so shows success)
let msg = SubMsg::reply_always(
Expand Down

0 comments on commit 5c325a3

Please sign in to comment.