Skip to content

Commit

Permalink
New solidity linter from Harbour && Fixed spaces indentation in javas…
Browse files Browse the repository at this point in the history
…cript
  • Loading branch information
tiero committed Nov 26, 2017
1 parent 889732e commit dd17205
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 153 deletions.
23 changes: 5 additions & 18 deletions dao/.soliumrc.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
{
"custom-rules-filename": null,
"extends": "solium:all",
"rules": {
"imports-on-top": true,
"variable-declarations": true,
"array-declarations": true,
"operator-whitespace": true,
"lbrace": true,
"mixedcase": true,
"camelcase": true,
"uppercase": true,
"no-with": true,
"no-empty-blocks": true,
"no-unused-vars": true,
"double-quotes": true,
"blank-lines": true,
"indentation": true,
"whitespace": true,
"deprecated-suicide": true,
"pragma-on-top": true
"indentation": ["error", 4],
"quotes": ["error", "double"],
"arg-overflow": "off",
"blank-lines": "off"
}
}
3 changes: 1 addition & 2 deletions dao/contracts/agent/Agent.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
pragma solidity ^0.4.18;

import "./AgentInterface.sol";
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';

import "zeppelin-solidity/contracts/ownership/Ownable.sol";

contract Agent is AgentInterface, Ownable {

Expand Down
3 changes: 1 addition & 2 deletions dao/contracts/agent/AgentFactory.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pragma solidity ^0.4.18;

import './Agent.sol';

import "./Agent.sol";

contract AgentFactory {

Expand Down
1 change: 0 additions & 1 deletion dao/contracts/agent/AgentInterface.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pragma solidity ^0.4.18;

import "../market/MarketJob.sol";


contract AgentInterface {

function sendPacket(address target, bytes packet) external;
Expand Down
11 changes: 5 additions & 6 deletions dao/contracts/foundation/AgiCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
pragma solidity ^0.4.18;

import '../tokens/SingularityNetToken.sol';
import 'zeppelin-solidity/contracts/math/SafeMath.sol';
import 'zeppelin-solidity/contracts/ReentrancyGuard.sol';
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';
import 'zeppelin-solidity/contracts/crowdsale/RefundVault.sol';

import "../tokens/SingularityNetToken.sol";
import "zeppelin-solidity/contracts/math/SafeMath.sol";
import "zeppelin-solidity/contracts/ReentrancyGuard.sol";
import "zeppelin-solidity/contracts/ownership/Ownable.sol";
import "zeppelin-solidity/contracts/crowdsale/RefundVault.sol";

/**
* @title AgiCrowdsale
Expand Down
5 changes: 1 addition & 4 deletions dao/contracts/market/Escrow.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
pragma solidity ^0.4.11;


import 'zeppelin-solidity/contracts/ownership/Ownable.sol';


import "zeppelin-solidity/contracts/ownership/Ownable.sol";

contract Escrow is Ownable {

Expand Down
6 changes: 3 additions & 3 deletions dao/contracts/market/MarketJob.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pragma solidity ^0.4.18;

import 'zeppelin-solidity/contracts/math/SafeMath.sol';
import '../tokens/SingularityNetToken.sol';
import './MarketJobInterface.sol';
import "zeppelin-solidity/contracts/math/SafeMath.sol";
import "../tokens/SingularityNetToken.sol";
import "./MarketJobInterface.sol";


contract MarketJob is MarketJobInterface {
Expand Down
3 changes: 1 addition & 2 deletions dao/contracts/market/MarketJobFactory.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pragma solidity ^0.4.18;

import './MarketJob.sol';

import "./MarketJob.sol";

contract MarketJobFactory {

Expand Down
46 changes: 23 additions & 23 deletions dao/test/TestAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,45 @@ const Agent = artifacts.require('agent/Agent.sol')

contract('Agent', function () {

let agent
let agent

beforeEach(async () => {
agent = await Agent.new()
})
beforeEach(async () => {
agent = await Agent.new()
})

it('verifies that somehow can append bytes of data to the agent', async () => {
it('verifies that somehow can append bytes of data to the agent', async () => {

let result = await agent.appendPacket("0x0")
assert.isNotNull(result)
let result = await agent.appendPacket("0x0")
assert.isNotNull(result)

})
})

it('verifies that somehow can get bytes of data from the agent', async () => {
it('verifies that somehow can get bytes of data from the agent', async () => {

let result = await agent.appendPacket("0x0")
let packet = await agent.getPacket(0)
console.log(packet)
assert.isNotNull(packet)
let result = await agent.appendPacket("0x0")
let packet = await agent.getPacket(0)
console.log(packet)
assert.isNotNull(packet)

})
})

it('verifies that somehow can send bytes of data to an agent', async () => {
it('verifies that somehow can send bytes of data to an agent', async () => {

const agent2 = await Agent.new()
const agent2 = await Agent.new()

await agent.appendPacket("0x0101")
await agent.appendPacket("0x0101")

let packet = await agent.getPacket(0)
let packet = await agent.getPacket(0)

await agent2.sendPacket(agent2.address,packet)
await agent2.sendPacket(agent2.address, packet)

let packet2 = await agent2.getPacket(0)
let packet2 = await agent2.getPacket(0)

console.log(packet2)
console.log(packet2)

assert.isNotNull(packet2)
assert.isNotNull(packet2)

})
})



Expand Down
26 changes: 13 additions & 13 deletions dao/test/TestAgentFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ const Agent = artifacts.require('agent/Agentfactory.sol')

contract('AgentFactory', function () {

let agentFactory
let agentFactory

beforeEach(async () => {
agentFactory = await Agent.new()
})
beforeEach(async () => {
agentFactory = await Agent.new()
})

it('verifies that someone can create a new agent', async () => {
it('verifies that someone can create a new agent', async () => {

let result = await agentFactory.create()
assert.isNotNull(result)
let result = await agentFactory.create()
assert.isNotNull(result)

})
})

it('verifies that somehow can create multiple agents', async () => {
let result = await agentFactory.create()
let result2 = await agentFactory.create()
assert.notEqual(result,result2,'Errors, no multiple agents created')
})
it('verifies that somehow can create multiple agents', async () => {
let result = await agentFactory.create()
let result2 = await agentFactory.create()
assert.notEqual(result, result2, 'Errors, no multiple agents created')
})

})
66 changes: 33 additions & 33 deletions dao/test/TestAgentRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,48 @@ const AgentRegistry = artifacts.require('registries/AgentRegistry.sol');

contract('AgentRegistry', function (accounts) {

let registry
let registry

beforeEach(async () => {
registry = await AgentRegistry.new()
})
beforeEach(async () => {
registry = await AgentRegistry.new()
})

it('verifies that agent can be added to registry', async () => {
it('verifies that agent can be added to registry', async () => {

let result = await registry.addAgent(
0,
1,
20,
accounts[2]
)
let result = await registry.addAgent(
0,
1,
20,
accounts[2]
)

assert.equal(result.logs[0].event, 'AgentAdded', 'Agent was not added')
})
assert.equal(result.logs[0].event, 'AgentAdded', 'Agent was not added')
})

it('returns agent data at 0 position', async () => {
it('returns agent data at 0 position', async () => {

await registry.addAgent(
0,
1,
20,
accounts[2]
)
await registry.addAgent(
0,
1,
20,
accounts[2]
)

let result = await registry.getAgent.call(0)
assert.isNotNull(result)
})
let result = await registry.getAgent.call(0)
assert.isNotNull(result)
})

it('returns agents with service 0', async () => {
it('returns agents with service 0', async () => {

await registry.addAgent(
0,
1,
20,
accounts[2]
)
await registry.addAgent(
0,
1,
20,
accounts[2]
)

let result = await registry.getAgentsWithService.call(0)
assert.isNotNull(result)
let result = await registry.getAgentsWithService.call(0)
assert.isNotNull(result)
})

})
1 change: 0 additions & 1 deletion dao/test/TestMarketJob.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ contract('Market Job', function ([payer, firstAgent, secondAgent, thirdAgent]) {


it('DEPOSIT # only the payer can deposit AGI token', async () => {

const token = await AGIToken.new(payer, 1000)
const marketJob = await Market.new(
[firstAgent, secondAgent, thirdAgent], // agents
Expand Down
6 changes: 3 additions & 3 deletions dao/test/TestMarketJobFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const Factory = artifacts.require('market/MarketJobFactory.sol')
const MarketJob = artifacts.require('market/MarketJob.sol')
const AGIToken = artifacts.require('tokens/SingularityNetTokenMock.sol')

contract('Market Job Factory', function ([agent,payer]) {
contract('Market Job Factory', function ([agent, payer]) {
let factory
let token
let token

beforeEach(async () => {
token = await AGIToken.new(agent,100)
token = await AGIToken.new(agent, 100)
factory = await Factory.new()
})
// master agent: accounts[0]
Expand Down
Loading

0 comments on commit dd17205

Please sign in to comment.