From e72158a689d97ae54f3f546503f950f2f6d9b8e9 Mon Sep 17 00:00:00 2001 From: Nasr Date: Thu, 6 Jun 2024 11:34:50 -0400 Subject: [PATCH] fix: metadataupdate use bytearray --- crates/torii/core/src/processors/metadata_update.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/torii/core/src/processors/metadata_update.rs b/crates/torii/core/src/processors/metadata_update.rs index 07859743b2..a6d7f74cfe 100644 --- a/crates/torii/core/src/processors/metadata_update.rs +++ b/crates/torii/core/src/processors/metadata_update.rs @@ -4,6 +4,7 @@ use anyhow::{Error, Result}; use async_trait::async_trait; use base64::engine::general_purpose; use base64::Engine as _; +use cainome::cairo_serde::{ByteArray, CairoSerde}; use dojo_world::contracts::world::WorldContractReader; use dojo_world::metadata::{Uri, WorldMetadata}; use reqwest::Client; @@ -61,11 +62,7 @@ where let uri_len: u8 = event.data[1].try_into().unwrap(); let uri_str = if uri_len > 0 { - event.data[2..=uri_len as usize + 1] - .iter() - .map(parse_cairo_short_string) - .collect::, _>>()? - .concat() + ByteArray::cairo_deserialize(&event.data[2..=uri_len as usize + 1], 0)?.to_string()? } else { "".to_string() };