From 520a6e30a6ccd69447de5a1b5528c2c7ae6b4327 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 10 Sep 2020 10:17:20 +0100 Subject: [PATCH] Update smoke test storage hashes This branch has added extra functions to IColony, which as discussed in #644 means these variables need updating. --- docs/_Interface_IColony.md | 51 +++++++++++++ docs/_Interface_IColonyNetwork.md | 97 +++++++++++-------------- docs/_Interface_IMetaColony.md | 1 - test-smoke/colony-storage-consistent.js | 12 +-- 4 files changed, 99 insertions(+), 62 deletions(-) diff --git a/docs/_Interface_IColony.md b/docs/_Interface_IColony.md index 1393b9f84b..a432d9ec3b 100644 --- a/docs/_Interface_IColony.md +++ b/docs/_Interface_IColony.md @@ -206,6 +206,19 @@ Deobligate the user some amount of tokens, releasing the stake. |_amount|uint256|Amount of internal token we are deobligating. +### `deprecateExtension` + +Upgrade an extension in a colony. Secured function to authorised members. + + +**Parameters** + +|Name|Type|Description| +|---|---|---| +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier +|deprecated|bool|Whether to deprecate the extension or not + + ### `emitDomainReputationPenalty` Emit a negative domain reputation update. Available only to Arbitration role holders @@ -881,6 +894,19 @@ Called once when the colony is created to initialise certain storage slot values |_token|address|Address of the colony ERC20 Token +### `installExtension` + +Install an extension to the colony. Secured function to authorised members. + + +**Parameters** + +|Name|Type|Description| +|---|---|---| +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier +|version|uint256|The new extension version to install + + ### `makeExpenditure` Add a new expenditure in the colony. Secured function to authorised members. @@ -1536,6 +1562,18 @@ Transfer some amount of obligated tokens. Can be called by the arbitration role. |_recipient|address|Recipient of the transferred tokens. +### `uninstallExtension` + +Uninstall an extension from a colony. Secured function to authorised members. + + +**Parameters** + +|Name|Type|Description| +|---|---|---| +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier + + ### `updateColonyOrbitDB` Update a colony's orbitdb address. Can only be called by a colony with a registered subdomain @@ -1561,6 +1599,19 @@ Upgrades a colony to a new Colony contract version `_newVersion`. |_newVersion|uint|The target version for the upgrade +### `upgradeExtension` + +Upgrade an extension in a colony. Secured function to authorised members. + + +**Parameters** + +|Name|Type|Description| +|---|---|---| +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier +|newVersion|uint256|The version to upgrade to (must be one larger than the current version) + + ### `userCanSetRoles` Check whether a given user can modify roles in the target domain `_childDomainId`. Mostly a convenience function to provide a uniform interface for extension contracts validating permissions diff --git a/docs/_Interface_IColonyNetwork.md b/docs/_Interface_IColonyNetwork.md index 3bddff05bc..95c4521768 100644 --- a/docs/_Interface_IColonyNetwork.md +++ b/docs/_Interface_IColonyNetwork.md @@ -22,9 +22,9 @@ Adds a new Colony contract version and the address of associated `_resolver` con ### `addExtension` -Add a new extension/version to the Extensions repository. +Add a new extension resolver to the Extensions repository. -*Note: The extension version is queried from the resolver itself.* +*Note: Can only be called by the MetaColony.* **Parameters** @@ -32,7 +32,6 @@ Add a new extension/version to the Extensions repository. |---|---|---| |extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier |resolver|address|The deployed resolver containing the extension contract logic -|roles|bytes32|A bytes array containing the roles required by the extension ### `addr` @@ -131,18 +130,15 @@ Used by a user to claim any mining rewards due to them. This will place them in ### `createColony` -Overload of the simpler `createColony` -- creates a new colony in the network with a variety of options +Creates a new colony in the network, at version 3 -*Note: For the colony to mint tokens, token ownership must be transferred to the new colony* +*Note: This is now deprecated and will be removed in a future version* **Parameters** |Name|Type|Description| |---|---|---| -|_tokenAddress|address|Address of an ERC20 token to serve as the colony token -|_version|uint256|The version of colony to deploy (pass 0 for the current version) -|_colonyName|string|The label to register (if null, no label is registered) -|_orbitdb|string|The path of the orbitDB database associated with the user profile +|_tokenAddress|address|Address of an ERC20 token to serve as the colony token. **Return Parameters** @@ -152,15 +148,17 @@ Overload of the simpler `createColony` -- creates a new colony in the network wi ### `createColony` -Creates a new colony in the network, at version 3 +Creates a new colony in the network, with an optional ENS name -*Note: This is now deprecated and will be removed in a future version* +*Note: For the colony to mint tokens, token ownership must be transferred to the new colony* **Parameters** |Name|Type|Description| |---|---|---| -|_tokenAddress|address|Address of an ERC20 token to serve as the colony token. +|_tokenAddress|address|Address of an ERC20 token to serve as the colony token +|_version|uint256|The version of colony to deploy (pass 0 for the current version) +|_colonyName|string|The label to register (if null, no label is registered) **Return Parameters** @@ -170,7 +168,7 @@ Creates a new colony in the network, at version 3 ### `createColony` -Overload of the simpler `createColony` -- creates a new colony in the network with a variety of options +Overload of the simpler `createColony` -- creates a new colony in the network with a variety of options, at version 4 *Note: This is now deprecated and will be removed in a future version* @@ -181,7 +179,7 @@ Overload of the simpler `createColony` -- creates a new colony in the network wi |_tokenAddress|address|Address of an ERC20 token to serve as the colony token |_version|uint256|The version of colony to deploy (pass 0 for the current version) |_colonyName|string|The label to register (if null, no label is registered) -|_orbitdb|string|The path of the orbitDB database associated with the user profile +|_orbitdb|string|DEPRECATED Currently a no-op |_useExtensionManager|bool|DEPRECATED Currently a no-op **Return Parameters** @@ -202,6 +200,19 @@ Create the Meta Colony, same as a normal colony plus the root skill. |_tokenAddress|address|Address of the CLNY token +### `deprecateExtension` + +Deprecate an extension in a colony. Can only be called by a Colony. + + +**Parameters** + +|Name|Type|Description| +|---|---|---| +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier +|deprecated|bool|Whether to deprecate the extension or not + + ### `deprecateSkill` Mark a global skill as deprecated which stops new tasks and payments from using it. @@ -316,56 +327,39 @@ Returns the address of the ENSRegistrar for the Network. ### `getExtensionInstallation` - +Get an extension's installation. **Parameters** |Name|Type|Description| |---|---|---| -|extensionId|bytes32| -|colony|address| +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier +|colony|address|Address of the colony the extension is installed in **Return Parameters** |Name|Type|Description| |---|---|---| -|address|address| +|installation|address|The address of the installed extension ### `getExtensionResolver` - +Get an extension's resolver. **Parameters** |Name|Type|Description| |---|---|---| -|extensionId|bytes32| -|version|uint256| - -**Return Parameters** - -|Name|Type|Description| -|---|---|---| -|address|address| - -### `getExtensionRoles` - - - - -**Parameters** - -|Name|Type|Description| -|---|---|---| -|extensionId|bytes32| +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier +|version|uint256|Version of the extension **Return Parameters** |Name|Type|Description| |---|---|---| -|bytes32|bytes32| +|resolver|address|The address of the deployed resolver ### `getFeeInverse` @@ -633,16 +627,15 @@ Creates initial inactive reputation mining cycle. ### `installExtension` - +Install an extension in a colony. Can only be called by a Colony. **Parameters** |Name|Type|Description| |---|---|---| -|extensionId|bytes32| -|version|uint256| -|colony|address| +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier +|version|uint256|Version of the extension to install ### `isColony` @@ -812,7 +805,7 @@ Called to set the total per-cycle reputation reward, which will be split between ### `setReputationRootHash` -Set a new Reputation root hash and starts a new mining cycle. Can only be called by the ReputationMiningCycle contract. +This version of setReputationRootHash is deprecated and will be removed in a future release. It transparently calls the new version if it is called (essentially, removing the `reward` parameter. **Parameters** @@ -822,11 +815,12 @@ Set a new Reputation root hash and starts a new mining cycle. Can only be called |newHash|bytes32|The reputation root hash |newNLeaves|uint256|The updated leaves count value |stakers|address[]|Array of users who submitted or backed the hash, being accepted here as the new reputation root hash +|reward|uint256|Amount of CLNY to be distributed as reward to miners (not used) ### `setReputationRootHash` -This version of setReputationRootHash is deprecated and will be removed in a future release. It transparently calls the new version if it is called (essentially, removing the `reward` parameter. +Set a new Reputation root hash and starts a new mining cycle. Can only be called by the ReputationMiningCycle contract. **Parameters** @@ -836,7 +830,6 @@ This version of setReputationRootHash is deprecated and will be removed in a fut |newHash|bytes32|The reputation root hash |newNLeaves|uint256|The updated leaves count value |stakers|address[]|Array of users who submitted or backed the hash, being accepted here as the new reputation root hash -|reward|uint256|Amount of CLNY to be distributed as reward to miners (not used) ### `setTokenLocking` @@ -915,15 +908,14 @@ Query if a contract implements an interface ### `uninstallExtension` - +Uninstall an extension in a colony. Can only be called by a Colony. **Parameters** |Name|Type|Description| |---|---|---| -|extensionId|bytes32| -|colony|address| +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier ### `unstakeForMining` @@ -964,13 +956,12 @@ Update a user's orbitdb address. Can only be called by a user with a registered ### `upgradeExtension` - +Upgrade an extension in a colony. Can only be called by a Colony. **Parameters** |Name|Type|Description| |---|---|---| -|extensionId|bytes32| -|colony|address| -|newVersion|uint256| \ No newline at end of file +|extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier +|newVersion|uint256|Version of the extension to upgrade to (must be one greater than current) \ No newline at end of file diff --git a/docs/_Interface_IMetaColony.md b/docs/_Interface_IMetaColony.md index 39008769a7..dd92a95eb2 100644 --- a/docs/_Interface_IMetaColony.md +++ b/docs/_Interface_IMetaColony.md @@ -19,7 +19,6 @@ Add a new extension/version to the Extensions repository. |---|---|---| |_extensionId|bytes32|keccak256 hash of the extension name, used as an indentifier |_resolver|address|The deployed resolver containing the extension contract logic -|_roles|bytes32|A byte array containing the roles required by the extension ### `addGlobalSkill` diff --git a/test-smoke/colony-storage-consistent.js b/test-smoke/colony-storage-consistent.js index e1fdede205..6d92ec6af1 100644 --- a/test-smoke/colony-storage-consistent.js +++ b/test-smoke/colony-storage-consistent.js @@ -153,15 +153,11 @@ contract("Contract Storage", (accounts) => { console.log("miningCycleStateHash:", miningCycleAccount.stateRoot.toString("hex")); console.log("tokenLockingStateHash:", tokenLockingAccount.stateRoot.toString("hex")); - expect(colonyNetworkAccount.stateRoot.toString("hex")).to.equal("4795c6cf36580719d2b3122e8a2d314024e5eb67ef0925dc35c5bbbcb26e20c9"); - - expect(colonyAccount.stateRoot.toString("hex")).to.equal("8de351231d2738f6d6f3a680e986461029afb48b1638e06a40b07e70604dab66"); - + expect(colonyNetworkAccount.stateRoot.toString("hex")).to.equal("db135eb0f95ae2cc2ae50c14a5f66ee497646024feedcd1f87cc013068989d4a"); + expect(colonyAccount.stateRoot.toString("hex")).to.equal("d03908010dec47dd2a1b8e6101e30d3c3546130905e0bdff4b39a0597d0f7980"); expect(metaColonyAccount.stateRoot.toString("hex")).to.equal("867fa1b5d2ada64ae601031e0654f9b2d7a1cc024493fac71e13ef91fb862119"); - - expect(miningCycleAccount.stateRoot.toString("hex")).to.equal("47ed02166271709fee6816f42d511e3d0c56e4ee5fc1f2e24c5f05a3954d0292"); - - expect(tokenLockingAccount.stateRoot.toString("hex")).to.equal("97a15b06a12c2300869568a1b32f6f60c9b87d0102ee5de7f52290b49c0eb891"); + expect(miningCycleAccount.stateRoot.toString("hex")).to.equal("6e06f76ad3caff1649fad8e2ae3f42eef7bb9c55dab13e6514d45ec65864993f"); + expect(tokenLockingAccount.stateRoot.toString("hex")).to.equal("27ec15478ee91943b5d98205085f20fa7255f4b77747931fbf488c5d0d0bfbaa"); }); }); });