LimeChain / matchstick

🔥 Unit testing framework for Subgraph development on The Graph protocol. ⚙️
MIT License
210 stars 18 forks source link

Required fields should not be warned if the fields have `@derivedFrom` directive #209

Closed wardenluna closed 2 years ago

wardenluna commented 3 years ago

Description

As Matchstick v0.2.0 provides ability to produce warnings if there are some required fields that are not set after save() was run, fields with @derivedFrom directive should not be included in this scenario since they are virtual field that should be ok if not setting it in the subgraph code.

Suggestion

additional filter may be added to this part of code to check whether each field has @derivedFrom directive.

https://github.com/LimeChain/matchstick/blob/1c0161174e998e02321bb2ee0e9fec79fca025ec/src/context.rs#L276-L298

VIVelev commented 3 years ago

Yep, you are right. Thanks @wardenluna! Will fix that.