Skip to content

Commit 8d06225

Browse files
authored
Merge pull request #19 from barlock/helpers
Upgrade to newest standards set!
2 parents 272ed84 + 2008df0 commit 8d06225

30 files changed

+324
-420
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
**/coverage/
22
**/build/
3+
**/.0x-artifacts/
34
**/node_modules/
45

56
**/coverage.json

.solhint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["solhint:recommended", "web3studio"]
3+
}
File renamed without changes.

.soliumrc.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,22 @@
44
"scripts": {
55
"test": "yarn lint && yarn test:packages",
66
"test:packages": "lerna run test --concurrency 1 --stream",
7-
"lint": "yarn eslint . && yarn solium -d .",
8-
"prettier": "prettier \"**/*.{js,json,css,md}\" --write"
7+
"lint": "yarn lint:js && yarn lint:sol",
8+
"lint:js": "eslint .",
9+
"lint:sol": "solhint \"**/*.sol\" -f stylish",
10+
"prettier": "prettier \"**/*.{js,json,css,md,sol,yml}\" --write"
911
},
1012
"devDependencies": {
11-
"@0x/sol-coverage": "^3.0.4",
12-
"@0x/sol-trace": "^2.0.4",
1313
"dotenv": "^6.2.0",
1414
"eslint": "^5.16.0",
15-
"eslint-config-web3studio": "^1.2.0",
15+
"eslint-config-web3studio": "^3.0.0",
1616
"husky": "^2.2.0",
17-
"jest-matchers": "^20.0.3",
1817
"lerna": "^3.5.0",
1918
"prettier": "^1.17.0",
2019
"pretty-quick": "^1.10.0",
21-
"solium": "^1.2.4",
22-
"solium-config-web3studio": "^1.2.0",
23-
"truffle": "^5.0.17"
20+
"solhint": "^2.1.0",
21+
"solhint-config-web3studio": "^3.0.0",
22+
"web3studio-helpers": "^3.0.0"
2423
},
2524
"workspaces": {
2625
"packages": [

packages/message-bus/.istanbul.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
check:
2+
global:
3+
statements: 100
4+
branches: 100
5+
functions: 100
6+
lines: 100

packages/message-bus/bin/sidejam-setup-ganache

Lines changed: 0 additions & 35 deletions
This file was deleted.

packages/message-bus/bin/sidejam-truffle-test

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/message-bus/contracts/MessageReceiver.sol

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
contract MessageReceiver {
4-
54
// Each receiver manages messages for only one topic
65
string public topicName;
76
// Message key to message mapping for look-up
@@ -22,7 +21,7 @@ contract MessageReceiver {
2221
*
2322
* @param topic string The topic name for the messages
2423
*/
25-
constructor (string memory topic) public {
24+
constructor(string memory topic) public {
2625
topicName = topic;
2726
}
2827

@@ -37,24 +36,28 @@ contract MessageReceiver {
3736
messages[key].sender = msg.sender;
3837
messages[key].message = newMessage;
3938

40-
emit MessageReceived(topicName, msg.sender, key);
39+
emit MessageReceived(topicName, msg.sender, key);
4140
}
4241

4342
/**
4443
* @notice Gets the count of the messages sent to this topic
45-
*
44+
*
4645
* @return uint256 Count of messages
4746
*/
48-
function getMessageCount() public view returns(uint256) {
47+
function getMessageCount() public view returns (uint256) {
4948
return messageList.length;
5049
}
5150

5251
/**
5352
* @notice Gets a message given a key
5453
*
55-
* @return address, string Returns the sender address and message contents
54+
* @return address, string Returns the sender address and message contents
5655
*/
57-
function getMessage(bytes32 key) public view returns (address, string memory) {
56+
function getMessage(bytes32 key)
57+
public
58+
view
59+
returns (address, string memory)
60+
{
5861
return (messages[key].sender, messages[key].message);
5962
}
60-
}
63+
}

packages/message-bus/contracts/Migrations.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity >=0.4.21 <0.6.0;
1+
pragma solidity 0.5.8;
22

33
contract Migrations {
44
address public owner;

0 commit comments

Comments
 (0)