v0.6.0 #415
dimitrovmaksim
announced in
Announcements
v0.6.0
#415
Replies: 1 comment 2 replies
-
Hi @dimitrovmaksim love the new features thanks for that <3 I particularly like the Thanks for such an amazing lib |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What's Changed
loadInBlock
method by @arrusev in ImplementloadInBlock
method #398loadRelated
method by @arrusev in ImplementloadRelated
method #399logEntity
function by @arrusev in AddlogEntity
function #405Breaking Changes:
Requires
matcshtick-as
0.6.0Dropped support for MacOs 10.15 - Action runner deprecated
Dropped support for Ubuntu 18.04 - Action runner deprecated
Dropped support for Ubuntu 20.04 - Issues with building graph-node dependencies
Changed handling derived fields
Looking up derived entities will no longer be possible by directly calling the derived field of the entity , e.g.
entity.derived_field
, and they will not be present when logging the store withlogStore()
.To load the derived entities in your tests, you will need to use loadRelated, e.g.
entity.derived_field.load()
. To log the derived entities we have introduced a new functionlogEntity(entity: string, id: string, showRelated: boolean)
which will load the parent entity and optionally can be called to load the related entities, similarly how queries return the derived fields.Added support for
loadRelated
Previously it was possible to get the derived entities by accessing them as Entity fields/properties
This was causing a lot of issues, because we had to track and save all entity change into our store. With adding Bytes as possible type. for the entity ID, things became even more complicated. With graph-node adding
loadRelated
we decided take a moregraph-node
approach. Derived fields actually do not exists in the Store/Database and are dynamically collected when you perform a query or useloadRelated
. Now with the added support forloadRelated
you can get the derived entities the same way you would do in your handlers.logEntity
Due to the changes to how we handle the derived fields (we are trying to be as close to graph-node as possible),
logStore
will no longer print the derived fields. For that reason we added another functionlogEntity(entity: string, id: string, showRelated: boolean)
which takes the Entity type, entity id and showRelated boolean argument to indicate if we want to print the related derived entities.Added support for
loadInBlock
By default
loadInBlock
will returnnull
. We have introducedmockInBlockStore
that will allow users to mock entities into the block cache.Added support for dynamic DataSource creation testing
It is now possible to test if a new DataSource has been created from a template. It supports both
ethereum/contract
andfile/ipfs
templates. We added four new functions:assert.dataSourceCount(templateName, expectedCount)
- assert the expected count of DataSources from the specified templateassert.dataSourceExists(templateName, address/ipfsHash)
- assert that a DataSource with the specified identifier (could be a contract address or IPFS file hash) from a specified template was createdlogDataSources(templateName)
- Print all DataSources from the specified template to the console for debugging purposes.readFile(path)
- Function that reads a json file that represents an IPFS file and returns the content as BytesTesting
ethereum/contract
templateslogDataSource:
Testing
file/ipfs
templatesSimilarly to contract dynamic DataSources it is now possible to test File DataSources and their handlers
subgraph.yaml
:schema.graphql
:metadata.json
./src/token-lock-wallet.ts
:./tests/token-lock-wallet.test.ts
:Added custom messages to asserts
All asserts now support setting a custom error message
New Contributors
loadInBlock
method #398Full Changelog: 0.5.4...0.6.0
This discussion was created from the release v0.6.0.
Beta Was this translation helpful? Give feedback.
All reactions