-
Notifications
You must be signed in to change notification settings - Fork 22
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 contract to let editors just publish stuff #90
Conversation
5c6a6cc
to
6ebdafc
Compare
mapping(uint => Content) private content; | ||
mapping(uint => bool) private waiting; | ||
mapping(uint => bool) private approved; | ||
mapping(uint => Revision) private content; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can make this mapping public, actually, and get rid of the getters (see PR 86 changes to Listing/Challenge/Appeal mappings)
event ContentProposed(address indexed author, uint indexed id); | ||
event ContentApproved(uint id); | ||
event ContentDenied(uint id); | ||
event ContentAdded(address indexed editor, uint indexed id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added -> Published might be more clear? Also might be worth it to add a bit more info to this event (url would be helpful)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RevisionPublished? Then we can have a separate event that fires in addition to this one if the article is brand new, as opposed to just a revision
@@ -11,6 +11,7 @@ const expect = chai.expect; | |||
|
|||
const FIRST_NEWSROOM_NAME = "TEST NAME, PLEASE IGNORE"; | |||
const SOME_URI = "http://thiistest.uri"; | |||
const SOME_HASH = web3.sha3(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for this you should be able to just do const SOME_HASH = "0x01"
@@ -56,41 +32,28 @@ contract Newsroom is ACL { | |||
_removeRole(who, role); | |||
} | |||
|
|||
function proposeContent(string contentUri) public requireRole(ROLE_REPORTER) returns (uint) { | |||
function addContent(string contentUri, bytes32 contentHash) public requireRole(ROLE_EDITOR) returns (uint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publishContent() feels better
9b2b811
to
705a8a9
Compare
adding changes to core |
6a9d5ed
to
a4dbe4b
Compare
ee685bc
to
ca4a90a
Compare
@@ -14,7 +14,7 @@ const debug = Debug("civil:main"); | |||
|
|||
export interface CivilOptions { | |||
web3Provider?: Web3.Provider; | |||
contentProvider?: ContentProvider; | |||
ContentProvider?: ContentProviderCreator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is ContentProvider capitalized here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its a Class definition not an instance
ipfs.add(Buffer.from(content), (err: any, ipfsHash: any) => { | ||
resolve(this.scheme() + "://" + ipfsHash[0].path); | ||
resolve({ uri: this.scheme() + "://" + ipfsHash[0].path, hash: ipfsHash }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ipfsHash here is actually poorly named. ipfsHash[0].path gets the actual hash, I believe
ca4a90a
to
89b437f
Compare
…ut takes variables
89b437f
to
790fc6d
Compare
790fc6d
to
8b177d1
Compare
Wooooo |
No description provided.