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

Create new index for tracking Asset metadata #2445

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

maschad
Copy link
Member

@maschad maschad commented Nov 20, 2024

Linked Issues/PRs

Description

This introduces a new GraphQL endpoint that returns info about an asset.

The off-chain worker indexes Mint and Burn events to store this metadata about an AssetId

Checklist

  • New behavior is reflected in tests

Before requesting review

  • I have reviewed the code myself

After merging, notify other teams

[Add or remove entries as needed]

@maschad maschad self-assigned this Nov 20, 2024
..
} => {
let asset_id = AssetId::from(**contract_id);
let current_count = db
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to increase/decrease based on the minted/burned amount=)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch 😄 ab09b8d

}

#[tokio::test]
#[ignore] // TODO: Need to be able to mint assets for this test to work
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not quite sure how to enable permissions to be able to mint assets for the purposes of this test

@maschad maschad requested a review from xgreenx November 22, 2024 20:41
@maschad maschad marked this pull request as ready for review November 22, 2024 20:41
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.

Add indexation AssetId -> (ContractId, SubId)
2 participants