DisputableVoting: Implement connector models#181
Conversation
Codecov Report
@@ Coverage Diff @@
## master #181 +/- ##
==========================================
+ Coverage 27.14% 32.57% +5.42%
==========================================
Files 81 96 +15
Lines 1477 1747 +270
Branches 251 273 +22
==========================================
+ Hits 401 569 +168
- Misses 1076 1178 +102
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
| return data.dao | ||
| } | ||
|
|
||
| onDao(callback: Function): SubscriptionHandler { |
There was a problem hiding this comment.
I wonder in which cases we may have a subscription to onDao? 🤔
There was a problem hiding this comment.
I was kind of inclined to do this due to Pierre's suggestion (see here), however, maybe we can avoid those that may not be necessary
There was a problem hiding this comment.
Oh, cool, I think we can avoid some of them 👍
| import { SettingData } from '../../types' | ||
|
|
||
| function buildSetting(setting: any, connector: any): Setting { | ||
| const { |
There was a problem hiding this comment.
I wonder if we may use spread syntax to build the settingData we need?
There was a problem hiding this comment.
not sure I follow :)
There was a problem hiding this comment.
I mean something like:
const settingData = {
...setting,
votingId: setting.voting.id
}
But maybe if we do that we break the SettingData interface 🤔
There was a problem hiding this comment.
Yes, it breaks it cause we will include some objects like setting.voting that are not part of the interface, I think at some point we need to do some filtering.
What we could do is to use Object.assign in the entity constructor since it is receiving an object that implements the expected interface
Co-authored-by: Gabriel Garcia <gabrielpk.18@gmail.com>
MERGE AFTER #178