Skip to content

Commit

Permalink
fix: metadataupdate use bytearray
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Jun 6, 2024
1 parent 9e25713 commit e72158a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/torii/core/src/processors/metadata_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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::<Result<Vec<_>, _>>()?
.concat()
ByteArray::cairo_deserialize(&event.data[2..=uri_len as usize + 1], 0)?.to_string()?
} else {
"".to_string()
};
Expand Down

0 comments on commit e72158a

Please sign in to comment.