Unverified Commit 51397577 authored by Chris's avatar Chris Committed by GitHub
Browse files

Make sure constructor selector is looking for the exact function name (#562)

* Make sure constructor selector is looking for the exact function name

* fmt
parent cef152e4
Pipeline #194401 passed with stages
in 10 minutes and 55 seconds
......@@ -180,8 +180,7 @@ impl<'a> ContractMessageTranscoder<'a> {
}
fn find_message_spec(&self, name: &str) -> Option<&MessageSpec<PortableForm>> {
self.messages()
.find(|msg| msg.label().contains(&name.to_string()))
self.messages().find(|msg| msg.label() == &name.to_string())
}
fn find_constructor_spec(
......@@ -189,7 +188,7 @@ impl<'a> ContractMessageTranscoder<'a> {
name: &str,
) -> Option<&ConstructorSpec<PortableForm>> {
self.constructors()
.find(|msg| msg.label().contains(&name.to_string()))
.find(|msg| msg.label() == &name.to_string())
}
pub fn decode_contract_event(&self, data: &mut &[u8]) -> Result<Value> {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment