Skip to content

Commit 6ccf997

Browse files
committed
fix code style
1 parent ad15f02 commit 6ccf997

File tree

3 files changed

+42
-44
lines changed

3 files changed

+42
-44
lines changed

contracts/Operations.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ contract Operations {
5252
function addChecksum(bytes32 _release, bytes32 _platform, bytes32 _checksum)
5353
public;
5454

55+
function setClientOwner(address _newOwner)
56+
public;
57+
5558
function isLatest(bytes32 _client, bytes32 _release)
5659
public
5760
view
@@ -96,7 +99,4 @@ contract Operations {
9699
public
97100
view
98101
returns (bytes32);
99-
100-
function setClientOwner(address _newOwner)
101-
public;
102102
}

contracts/OperationsProxy.sol

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ import "./Operations.sol";
2222
/// Specialise proxy wallet. Owner can send transactions unhindered. Delegates
2323
/// can send only particular transactions to a named Operations contract.
2424
contract OperationsProxy {
25+
event OwnerChanged(address indexed was, address indexed who);
26+
event DelegateChanged(address indexed was, address indexed who, uint8 indexed track);
27+
event ConfirmerChanged(address indexed was, address indexed who, uint8 indexed track);
28+
event NewRequestWaiting(uint8 indexed track, bytes32 hash);
29+
event RequestConfirmed(uint8 indexed track, bytes32 hash, bool success);
30+
event RequestRejected(uint8 indexed track, bytes32 hash);
31+
2532
address public owner;
2633
mapping(uint8 => address) public delegate;
2734
mapping(uint8 => address) public confirmer;
@@ -32,14 +39,22 @@ contract OperationsProxy {
3239

3340
Operations public operations;
3441

35-
event OwnerChanged(address indexed was, address indexed who);
36-
event DelegateChanged(address indexed was, address indexed who, uint8 indexed track);
37-
event ConfirmerChanged(address indexed was, address indexed who, uint8 indexed track);
38-
event NewRequestWaiting(uint8 indexed track, bytes32 hash);
39-
event RequestConfirmed(uint8 indexed track, bytes32 hash, bool success);
40-
event RequestRejected(uint8 indexed track, bytes32 hash);
42+
modifier onlyOwner {
43+
require(msg.sender == owner);
44+
_;
45+
}
46+
47+
modifier onlyDelegateOf(uint8 track) {
48+
require(delegate[track] == msg.sender);
49+
_;
50+
}
51+
52+
modifier onlyConfirmerOf(uint8 track) {
53+
require(confirmer[track] == msg.sender);
54+
_;
55+
}
4156

42-
function OperationsProxy(
57+
constructor(
4358
address _owner,
4459
address _stable,
4560
address _beta,
@@ -189,19 +204,4 @@ contract OperationsProxy {
189204
o_relayed = false;
190205
}
191206
}
192-
193-
modifier onlyOwner {
194-
require(msg.sender == owner);
195-
_;
196-
}
197-
198-
modifier onlyDelegateOf(uint8 track) {
199-
require(delegate[track] == msg.sender);
200-
_;
201-
}
202-
203-
modifier onlyConfirmerOf(uint8 track) {
204-
require(confirmer[track] == msg.sender);
205-
_;
206-
}
207207
}

contracts/SimpleOperations.sol

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,23 @@ contract SimpleOperations is Operations {
4646
uint32 public latestFork = 0;
4747
address public grandOwner = msg.sender;
4848

49-
function SimpleOperations()
49+
modifier onlyOwner {
50+
require(grandOwner == msg.sender);
51+
_;
52+
}
53+
54+
modifier onlyClientOwner {
55+
bytes32 newClient = clientOwner[msg.sender];
56+
require(newClient != 0);
57+
_;
58+
}
59+
60+
modifier notClientOwner(address owner) {
61+
require(clientOwner[owner] == 0);
62+
_;
63+
}
64+
65+
constructor()
5066
public
5167
{
5268
client["parity"] = Client(msg.sender);
@@ -286,22 +302,4 @@ contract SimpleOperations is Operations {
286302
Release storage r = client[_client].release[_release];
287303
return clientExists(_client) && r.track != 0 && r.semver != 0;
288304
}
289-
290-
// Modifiers
291-
292-
modifier onlyOwner {
293-
require(grandOwner == msg.sender);
294-
_;
295-
}
296-
297-
modifier onlyClientOwner {
298-
bytes32 newClient = clientOwner[msg.sender];
299-
require(newClient != 0);
300-
_;
301-
}
302-
303-
modifier notClientOwner(address owner) {
304-
require(clientOwner[owner] == 0);
305-
_;
306-
}
307305
}

0 commit comments

Comments
 (0)