Skip to content

Commit

Permalink
Make sure constructor selector is looking for the exact function name (
Browse files Browse the repository at this point in the history
…use-ink#562)

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

* fmt
  • Loading branch information
forgetso authored May 18, 2022
1 parent cef152e commit 5139757
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cmd/extrinsics/transcode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,15 @@ 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(
&self,
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> {
Expand Down

0 comments on commit 5139757

Please sign in to comment.