Skip to content

Commit 0498dd7

Browse files
committed
Fix linting errors and integrate into CI
1 parent 7872ba5 commit 0498dd7

File tree

5 files changed

+73
-73
lines changed

5 files changed

+73
-73
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ install:
1717
- yarn global add coveralls
1818
- yarn install
1919
script:
20+
- yarn linter
2021
- yarn build
2122
- yarn deploy basic && yarn deploy extended && yarn deploy token
2223
- yarn coverage && cat coverage/lcov.info | coveralls

README.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ $ ganache-cli --gasLimit 8000000
5252

5353
Then, to run tests:
5454
```sh
55+
$ yarn linter
5556
$ yarn test
5657
$ yarn coverage
57-
$ yarn linter
5858
```
5959

60-
A jurisdiction may then be deployed locally using `yarn deploy basic` or `yarn deploy extended`.
60+
A jurisdiction may then be deployed locally using `yarn build` followed by `yarn deploy basic` or `yarn deploy extended`. A mock permissioned token that relies on the deployed jurisdiction can then be deployed using `yarn deploy token` (see [config.js](https://github.com/TPL-protocol/tpl-contracts/blob/master/config.js) for a few token configuration options).
6161

6262
## API
6363
*NOTE: This documentation is still a work in progress. See the relevant contract source code for additional information.*
6464
* [AttributeRegistryInterface](#attributeregistryinterface)
65-
* [getAttributeTypeID](#function-getattributetypeid)
6665
* [hasAttribute](#function-hasattribute)
6766
* [getAttributeValue](#function-getattributevalue)
6867
* [countAttributeTypes](#function-countattributetypes)
68+
* [getAttributeTypeID](#function-getattributetypeid)
6969
* [BasicJurisdictionInterface](#basicjurisdictioninterface)
7070
* [getAttributeTypeID](#function-getattributetypeid)
7171
* [getAttributeValidator](#function-getattributevalidator)
@@ -149,25 +149,6 @@ A jurisdiction may then be deployed locally using `yarn deploy basic` or `yarn d
149149
### AttributeRegistryInterface
150150
---
151151

152-
#### *function* getAttributeTypeID
153-
154-
AttributeRegistryInterface.getAttributeTypeID(index) `view` `0e62fde6`
155-
156-
**Get the ID of the attribute type at index `index`.**
157-
158-
159-
Inputs
160-
161-
| **type** | **name** | **description** |
162-
|-|-|-|
163-
| *uint256* | index | uint256 The index of the attribute type in question. |
164-
165-
Outputs
166-
167-
| **type** | **name** | **description** |
168-
|-|-|-|
169-
| *uint256* | | undefined |
170-
171152
#### *function* hasAttribute
172153

173154
AttributeRegistryInterface.hasAttribute(account, attributeTypeID) `view` `4b5f297a`
@@ -223,7 +204,24 @@ Outputs
223204
|-|-|-|
224205
| *uint256* | | undefined |
225206

207+
#### *function* getAttributeTypeID
208+
209+
AttributeRegistryInterface.getAttributeTypeID(index) `view` `0e62fde6`
210+
211+
**Get the ID of the attribute type at index `index`.**
212+
213+
214+
Inputs
215+
216+
| **type** | **name** | **description** |
217+
|-|-|-|
218+
| *uint256* | index | uint256 The index of the attribute type in question. |
226219

220+
Outputs
221+
222+
| **type** | **name** | **description** |
223+
|-|-|-|
224+
| *uint256* | | undefined |
227225

228226
### BasicJurisdictionInterface
229227
---

contracts/AttributeRegistryInterface.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pragma solidity ^0.4.25;
22

3+
34
/**
45
* @title Attribute Registry interface. EIP-165 ID: 0x5f46473f
56
*/

contracts/examples/validator/TPLBasicValidatorInterface.sol

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ pragma solidity ^0.4.25;
55
* @title TPL Basic Validator interface. EIP-165 ID: 0xd13d3f23
66
*/
77
interface TPLBasicValidatorInterface {
8+
/**
9+
* @notice Issue an attribute of the type with ID `attributeTypeID` to account
10+
* `account` on the jurisdiction.
11+
* @param account address The account to issue the attribute to.
12+
* @param attributeTypeID uint256 The ID of the attribute type in question.
13+
* @dev Note that the function is payable - this is so that the function in
14+
* question can support both basic and extended jurisdictions. Attaching a
15+
* value when utilizing a basic jurisdiction will revert the transaction.
16+
*/
17+
function issueAttribute(
18+
address account,
19+
uint256 attributeTypeID
20+
) external payable;
21+
22+
/**
23+
* @notice Revoke an attribute of the type with ID `attributeTypeID` from
24+
* account `account` on the jurisdiction.
25+
* @param account address The account to revoke the attribute from.
26+
* @param attributeTypeID uint256 The ID of the attribute type in question.
27+
*/
28+
function revokeAttribute(address account, uint256 attributeTypeID) external;
29+
830
/**
931
* @notice Check if contract is assigned as a validator on the jurisdiction.
1032
* @return True if validator is assigned, false otherwise.
@@ -45,28 +67,6 @@ interface TPLBasicValidatorInterface {
4567
uint256 attributeTypeID
4668
) external view returns (bool, bytes1);
4769

48-
/**
49-
* @notice Issue an attribute of the type with ID `attributeTypeID` to account
50-
* `account` on the jurisdiction.
51-
* @param account address The account to issue the attribute to.
52-
* @param attributeTypeID uint256 The ID of the attribute type in question.
53-
* @dev Note that the function is payable - this is so that the function in
54-
* question can support both basic and extended jurisdictions. Attaching a
55-
* value when utilizing a basic jurisdiction will revert the transaction.
56-
*/
57-
function issueAttribute(
58-
address account,
59-
uint256 attributeTypeID
60-
) external payable;
61-
62-
/**
63-
* @notice Revoke an attribute of the type with ID `attributeTypeID` from
64-
* account `account` on the jurisdiction.
65-
* @param account address The account to revoke the attribute from.
66-
* @param attributeTypeID uint256 The ID of the attribute type in question.
67-
*/
68-
function revokeAttribute(address account, uint256 attributeTypeID) external;
69-
7070
/**
7171
* @notice Get account of utilized jurisdiction and associated attribute
7272
* registry managed by the jurisdiction.

contracts/examples/validator/TPLExtendedValidatorInterface.sol

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,35 @@ pragma solidity ^0.4.25;
66
* EIP-165 ID: 0x596c0405
77
*/
88
interface TPLExtendedValidatorInterface {
9+
/**
10+
* @notice Set a signing key on the jurisdiction with an associated public
11+
* key at address `newSigningKey`.
12+
* @param newSigningKey address The signing key to set.
13+
*/
14+
function setSigningKey(address newSigningKey) external;
15+
16+
/**
17+
* @notice Invalidate a signed attribute approval before it has been set by
18+
* supplying the hash of the approval `hash` and the signature `signature`.
19+
* @param hash bytes32 The hash of the attribute approval.
20+
* @param signature bytes The hash's signature, resolving to the signing key.
21+
*/
22+
function invalidateAttributeApproval(bytes32 hash, bytes signature) external;
23+
24+
/**
25+
* @notice Withdraw funds paid into the validator of amount `value` to the
26+
* account at `to`.
27+
* @param to address The address to withdraw to.
28+
* @param value uint256 The amount to withdraw.
29+
*/
30+
function withdraw(bytes32 to, uint256 value) external;
31+
32+
/**
33+
* @notice Get the validator's signing key on the jurisdiction.
34+
* @return The account referencing the public component of the signing key.
35+
*/
36+
function getSigningKey() external view returns (address);
37+
938
/**
1039
* @notice Check if the validator is approved to issue an attribute of the
1140
* type with ID `attributeTypeID` to account `account` on the jurisdiction
@@ -21,19 +50,6 @@ interface TPLExtendedValidatorInterface {
2150
uint256 value
2251
) external view returns (bool, bytes1);
2352

24-
/**
25-
* @notice Get the validator's signing key on the jurisdiction.
26-
* @return The account referencing the public component of the signing key.
27-
*/
28-
function getSigningKey() external view returns (address);
29-
30-
/**
31-
* @notice Set a signing key on the jurisdiction with an associated public
32-
* key at address `newSigningKey`.
33-
* @param newSigningKey address The signing key to set.
34-
*/
35-
function setSigningKey(address newSigningKey) external;
36-
3753
/**
3854
* @notice Get the hash of a given attribute approval from the jurisdiction.
3955
* @param account address The account specified by the attribute approval.
@@ -52,20 +68,4 @@ interface TPLExtendedValidatorInterface {
5268
uint256 fundsRequired,
5369
uint256 validatorFee
5470
) external view returns (bytes32 hash);
55-
56-
/**
57-
* @notice Invalidate a signed attribute approval before it has been set by
58-
* supplying the hash of the approval `hash` and the signature `signature`.
59-
* @param hash bytes32 The hash of the attribute approval.
60-
* @param signature bytes The hash's signature, resolving to the signing key.
61-
*/
62-
function invalidateAttributeApproval(bytes32 hash, bytes signature) external;
63-
64-
/**
65-
* @notice Withdraw funds paid into the validator of amount `value` to the
66-
* account at `to`.
67-
* @param to address The address to withdraw to.
68-
* @param value uint256 The amount to withdraw.
69-
*/
70-
function withdraw(bytes32 to, uint256 value) external;
7171
}

0 commit comments

Comments
 (0)