Skip to content

Commit

Permalink
feat: add cainome abigen to torii
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Dec 15, 2023
1 parent f67451e commit 71a1830
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/torii/client/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Client {
// TODO: change this to querying the gRPC url instead
let subbed_models = subbed_models.models_keys.read().clone();
for keys in subbed_models {
let model_reader = world_reader.model(&keys.model).await?;
let model_reader = world_reader.model_reader(&keys.model).await?;
let values = model_reader.entity_storage(&keys.keys).await?;

client_storage.set_model_storage(
Expand Down Expand Up @@ -137,7 +137,7 @@ impl Client {
};

if !self.subscribed_models.is_synced(keys) {
let model = self.world_reader.model(&keys.model).await?;
let model = self.world_reader.model_reader(&keys.model).await?;
return Ok(Some(model.entity(&keys.keys).await?));
}

Expand Down Expand Up @@ -232,7 +232,7 @@ impl Client {
}

async fn initiate_model(&self, model: &str, keys: Vec<FieldElement>) -> Result<(), Error> {
let model_reader = self.world_reader.model(model).await?;
let model_reader = self.world_reader.model_reader(model).await?;
let values = model_reader.entity_storage(&keys).await?;
self.storage.set_model_storage(
cairo_short_string_to_felt(model).map_err(ParseError::CairoShortStringToFelt)?,
Expand Down
2 changes: 1 addition & 1 deletion crates/torii/core/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl<'db, P: Provider + Sync> Engine<'db, P> {

let mut world_event = false;
for (event_idx, event) in invoke_receipt.events.iter().enumerate() {
if event.from_address != self.world.address() {
if event.from_address != self.world.address {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion crates/torii/core/src/processors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub mod store_transaction;
#[async_trait]
pub trait EventProcessor<P>
where
P: Provider,
P: Provider + Sync,
{
fn event_key(&self) -> String;

Expand Down
2 changes: 1 addition & 1 deletion crates/torii/core/src/processors/register_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ where
) -> Result<(), Error> {
let name = parse_cairo_short_string(&event.data[0])?;

let model = world.model(&name).await?;
let model = world.model_reader(&name).await?;
let schema = model.schema().await?;
let layout = model.layout().await?;

Expand Down

0 comments on commit 71a1830

Please sign in to comment.