Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(torii): fetch and process erc721 metadata and image #2544

Open
wants to merge 1 commit into
base: spr/main/bc10539f
Choose a base branch
from

Conversation

lambda-0x
Copy link
Collaborator

@lambda-0x lambda-0x commented Oct 16, 2024

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

Attention: Patch coverage is 13.50575% with 602 lines in your changes missing coverage. Please review.

Project coverage is 68.71%. Comparing base (ff46557) to head (5c702b8).

Files with missing lines Patch % Lines
crates/torii/core/src/executor.rs 13.17% 257 Missing ⚠️
crates/torii/server/src/artifacts.rs 0.00% 236 Missing ⚠️
bin/torii/src/main.rs 0.00% 36 Missing ⚠️
crates/torii/server/src/proxy.rs 0.00% 29 Missing ⚠️
crates/torii/core/src/sql/erc.rs 0.00% 28 Missing ⚠️
crates/torii/core/src/utils.rs 68.42% 6 Missing ⚠️
crates/torii/core/src/sql/mod.rs 0.00% 5 Missing ⚠️
...orii/core/src/processors/erc721_legacy_transfer.rs 0.00% 2 Missing ⚠️
...rates/torii/core/src/processors/erc721_transfer.rs 0.00% 2 Missing ⚠️
...rates/torii/core/src/processors/metadata_update.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           spr/main/bc10539f    #2544      +/-   ##
=====================================================
- Coverage              69.19%   68.71%   -0.48%     
=====================================================
  Files                    402      403       +1     
  Lines                  51039    51509     +470     
=====================================================
+ Hits                   35314    35394      +80     
- Misses                 15725    16115     +390     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rsodre
Copy link

rsodre commented Oct 23, 2024

There should be a way to notify Torii that metadata needs to be updated.

I opened an issue on OpenZeppelin to add ERC-4906, which implements the MetadataUpdate and BatchMetadataUpdate events, just for that.

I'm available to hurry it on the OZ side so we can add support to Torii.

Comment on lines +146 to +148
ongoing_futures: JoinSet<Result<RegisterErc721TokenMetadata>>,
deferred_query_messages: Vec<QueryMessage>,
provider: Arc<P>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add comments to mention why they are added?

// Queries should use `transaction` instead of `pool`
// This `pool` is only used to create a new `transaction`
pool: Pool<Sqlite>,
transaction: Transaction<'c, Sqlite>,
publish_queue: Vec<BrokerMessage>,
artifacts_path: Utf8PathBuf,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here comment for it's usage.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move all the token logic in a new module (maybe executor becomes a folder instead of a single file module)?

This will make the implementation clearer and the impact on the executor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants