Skip to content

Commit f8f05c9

Browse files
committed
fix(router-core): emit routed event with final_name instead of original name
resolve() was publishing the EVENT_ROUTED event with the originally-requested name (which could be an alias or pre-BestRoute lookup) while the resolved address belonged to final_name (the alias-resolved or best-scored route). This copy-paste bug meant the route name and address in the event referred to different routes. Now final_name is used consistently so the event always pairs the correct name with its actual address. Closes #792
1 parent b2c506f commit f8f05c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • contracts/router-core/src

contracts/router-core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ impl RouterCore {
839839

840840
env.events().publish(
841841
(Symbol::new(&env, router_common::EVENT_ROUTED),),
842-
(name.clone(), entry.address.clone()),
842+
(final_name.clone(), entry.address.clone()),
843843
);
844844

845845
Ok(entry.address)

0 commit comments

Comments
 (0)