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

Refactor: Use an static method to create Entities + Split Data and Metadata #110

Merged
merged 4 commits into from
Jul 5, 2020

Conversation

0xGabi
Copy link
Contributor

@0xGabi 0xGabi commented Jul 4, 2020

No description provided.

@codecov
Copy link

codecov bot commented Jul 4, 2020

Codecov Report

Merging #110 into master will decrease coverage by 0.17%.
The diff coverage is 3.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #110      +/-   ##
==========================================
- Coverage   28.12%   27.94%   -0.18%     
==========================================
  Files          54       54              
  Lines         889      873      -16     
  Branches      145      142       -3     
==========================================
- Hits          250      244       -6     
+ Misses        639      629      -10     
Flag Coverage Δ
#unittests 27.94% <3.89%> (-0.18%) ⬇️
Impacted Files Coverage Δ
packages/connect-core/src/entities/App.ts 0.00% <0.00%> (ø)
packages/connect-core/src/entities/Repo.ts 0.00% <0.00%> (ø)
packages/connect-core/src/entities/Role.ts 0.00% <0.00%> (ø)
packages/connect-thegraph/src/parsers/apps.ts 92.85% <100.00%> (-0.48%) ⬇️
packages/connect-thegraph/src/parsers/repos.ts 92.85% <100.00%> (-0.90%) ⬇️
packages/connect-thegraph/src/parsers/roles.ts 66.66% <100.00%> (-2.30%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43280b1...4ef6c80. Read the comment docs.

data.manifest
)

const metadata: Metadata = [artifact, manifest]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now we have a clear distinction between data and metadata. Probably during creation as well we will handle the overrides of the few contract that miss repos on aragonPM (Kernel, ACL, EVM, etc)

return this.#metadata[1] as AragonManifest
}

get abi(): Abi {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I only include getter for really useful properties. Otherwise, the dev can get them from the metadata files.

await repoEntity.create(data)

return repoEntity
return Repo.create(data, connector)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is how we create the entities now.

@0xGabi 0xGabi requested a review from bpierre July 4, 2020 00:49
Copy link
Contributor

@bpierre bpierre left a comment

Choose a reason for hiding this comment

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

😍

@0xGabi 0xGabi merged commit f56bac5 into master Jul 5, 2020
@0xGabi 0xGabi deleted the refactor-entities-creation branch July 5, 2020 17:42
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.

2 participants