Open glihm opened 2 weeks ago
Hello @glihm can you please assign this issue to me?
hello @glihm i can solve this issue
@ScottyDavies and @Code03hi happy to have your idea on how to solve that.
I'm afraid we may change the test runner, or simply internalize the models into the world contract.
ok
Describe the bug If a projects defines a model that has the name of a model into
dojo-core
, then the cairo test runner returns erroneous class hash of thedojo-core
model, which is not even included in the tests...Debugging this at the moment, opening this issue to track this behavior.
To Reproduce Steps to reproduce the behavior:
Character
to a project.dojo
namespace will be required when it shouldn't. This is because theCharacter
model of the project is actually being mapped to the class hash of thedojo-core
one.Expected behavior We shouldn't have this issue and we can have several models with same name, as they are isolated by the namespaces.
Additional context We had the idea before to internalize the models, and a recent discussion on the dojo discord was also evoking this aspect of
why do we need models having their own contract?
? We don't make direct use of the contracts, and we could easily have aModelDefinition
struct being held into the world's storage. Due to the use ofSpan
, an easy workaround is to keep the model's definition serialized (but this adds some extra steps too).