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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Solidity Linter to Travis #376

Merged
merged 17 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .soliumrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "solium:recommended",
"plugins": [
"security"
],
"rules": {
"quotes": [
"error",
"double"
],
"indentation": [
"error",
4
]
}
}
21 changes: 17 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ matrix:
install: true # Skip install go packages.

script:
# Ensure everything builds
# Ensure everything builds.
- |
bazel \
--bazelrc=.travis-bazelrc \
Expand All @@ -68,11 +68,24 @@ matrix:
# Check that BUILD files are formatted correctly.
- ./check_gazelle.sh

# Check that target visibility is correct..
# Check that target visibility is correct.
- ./check_visibility.sh

# Shutdown must be last.
- bazel shutdown
- bazel shutdown

notifications:
email: false

- language: node_js
os: linux
env:
- solidity
node_js:
- "lts/*"
before_install:
- npm install -g solium
install: true # Skip npm install.
script:
# Check solidity linter.
- solium -d contracts/
10 changes: 8 additions & 2 deletions contracts/validator_registration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ contract ValidatorRegistration {
)
public payable
{
require(msg.value == VALIDATOR_DEPOSIT);
require(!usedPubkey[_pubkey]);
require(
msg.value == VALIDATOR_DEPOSIT,
"Incorrect validator deposit"
);
require(
!usedPubkey[_pubkey],
"Public key already used"
);

usedPubkey[_pubkey] = true;

Expand Down