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

CI setup and minor enhancements #2

Merged
merged 11 commits into from
Mar 29, 2018
Merged

CI setup and minor enhancements #2

merged 11 commits into from
Mar 29, 2018

Conversation

kirushik
Copy link
Contributor

No description provided.

@kirushik kirushik requested review from andresilva and grbIzl March 28, 2018 19:31
Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

We could also update the tests to use async/await notation which imo makes it easier to read (https://github.com/parity-contracts/auto-updater/blob/andre-fix-more-lints/test/simple_operations.js).

// and allows its change only if all the Validators (from a static list, initialized in constructor)
// have signed a new state (hashed together with a current nonce, for replay protection).
//
//
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put the license header before the previous block comment describing the contract.

.travis.yml Outdated
script:
- yarn run ci
after_script:
- cat coverage/lcov.info | yarn run coveralls
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing indentation.

package.json Outdated
},

"devDependencies": {
"babel-polyfill": "^6.26.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't add babel in auto-updater because the js code will only be run on node, assuming a recent version of node it has all the features we need.

nonce = 1;
}

function getValidators() public constant returns (address[]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would break the modifier list. I saw this code style in some other repo and I think it makes it easier to notice the visibility of a function. But I'm open to change if people don't like it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have some accepted coding style guide for solidity contracts? As a result this contract looks like rust code )

Copy link
Contributor

Choose a reason for hiding this comment

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

No I don't think we have any defined style guide but I think it would be good if we could have some consistency across our different contracts. I followed the style guide here https://solidity.readthedocs.io/en/v0.4.21/style-guide.html, some of that stuff is actually reported by the linter. And I added the rule of always breaking modifiers into new lines. Let me know if you think we should use a different style or add/remove some rules.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the link. It's very helpful (I'm not the experienced solidity coder). So it's important to have such guide fixed and not a big deal what's inside. I can bear anything :-) As for breaking modifiers both options are ok.

@kirushik
Copy link
Contributor Author

@andresilva Weirdly enough, tests didn't work for me without explicit inclusion of babel.
Maybe it's because of our usage of bluebird? I'll rewrite the tests to use async/await (#3), and hopefully it'll allow me to drop babel.

@tomusdrw
Copy link

tomusdrw commented Mar 29, 2018

@kirushik What node --version? I suspect it might be old(ish).

@kirushik
Copy link
Contributor Author

kirushik commented Mar 29, 2018

@tomusdrw Well, that was the first thing I've checked for:

⟩ node --version
v9.10.0

I think it might be mocha incompatible with ES6, but I'm no node expert. Still, I'll try to tackle the issue by making my tests look more like @andresilva's =)

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

LGTM

@kirushik kirushik merged commit 874da28 into master Mar 29, 2018
@kirushik kirushik deleted the kirushik/ci_setup branch March 29, 2018 15:20
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.

4 participants