dojo icon indicating copy to clipboard operation
dojo copied to clipboard

feat: add ModelDefinition to Dojo Model

Open remybar opened this issue 5 months ago • 2 comments

Description

This PR adds the definition() function to Dojo models to be able to retrieve the full ModelDefinition at once instead of calling several functions to get each element one by one.

depends on https://github.com/dojoengine/dojo-core/pull/10.

TODO: remove dojo-core part as it has been moved to dojo-core repo.

Tests

  • [X] Yes
  • [ ] No, because they aren't needed
  • [ ] No, because I need help

Added to documentation?

  • [ ] README.md
  • [ ] Dojo Book
  • [X] No documentation needed

Checklist

  • [X] I've formatted my code (scripts/prettier.sh, scripts/rust_fmt.sh, scripts/cairo_fmt.sh)
  • [X] I've linted my code (scripts/clippy.sh, scripts/docs.sh)
  • [X] I've commented my code
  • [X] I've requested a review after addressing the comments

Summary by CodeRabbit

  • New Features

    • Introduced a new ModelDefinition structure to enhance model definitions, including fields for name, namespace, version, and more.
    • Added functions to retrieve model definitions and schemas across various interfaces, improving metadata management.
  • Bug Fixes

    • Updated class and original class hashes for multiple models to reflect recent changes in their implementations.
  • Documentation

    • Enhanced documentation to clarify the structure and purpose of the new ModelDefinition and related functions.

remybar avatar Sep 12 '24 08:09 remybar