Skip to content

Commit

Permalink
Fixing the issue with bad encoding (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
leboiko authored Jan 8, 2025
1 parent dfa46ee commit 037ca41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion consumer/src/mode/decoded/atom/atom_creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ impl AtomCreated {

/// This function decodes the atom data
fn decode_data(&self) -> Result<String, ConsumerError> {
Ok(String::from_utf8(self.atomData.clone().to_vec())?)
let filtered_bytes: Vec<u8> = self.atomData.iter().filter(|&&b| b != 0).cloned().collect();

Ok(String::from_utf8(filtered_bytes)?)
}

/// This function verifies if the atom wallet account exists in our DB. If it does, it returns it.
Expand Down

0 comments on commit 037ca41

Please sign in to comment.