Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to recover staked funds in misaligned motions #1082

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,24 @@ jobs:
root: ./
paths:
- coverage-contracts
test-upgrade-coverage:
<<: *job_common
steps:
- checkout
- <<: *step_restore_cache
- setup_remote_docker:
version: 19.03.13
- <<: *step_pull_solc_docker
- <<: *step_setup_global_packages
- run:
name: "Running upgrade tests with coverage"
command: yarn run test:contracts:upgrade:coverage
environment:
NODE_OPTIONS: --max_old_space_size=4096
- persist_to_workspace:
root: ./
paths:
- coverage-upgrade
test-contracts-extensions-coverage:
<<: *job_common
steps:
Expand Down Expand Up @@ -308,13 +326,16 @@ workflows:
context: dockerhub-credentials
- test-chainid-coverage:
context: dockerhub-credentials
- test-upgrade-coverage:
context: dockerhub-credentials
- check-coverage:
context: dockerhub-credentials
requires:
- test-contracts-coverage
- test-contracts-extensions-coverage
- test-reputation-coverage
- test-chainid-coverage
- test-upgrade-coverage
# nightly:
# triggers:
# - schedule:
Expand Down
39 changes: 39 additions & 0 deletions .solcover.upgrade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const { execSync } = require("child_process");
const log = console.log;

// Copies pre-built token artifacts to .coverage_artifacts/contracts
function provisionTokenContracts(config){
let output;
const provisionColonyToken = `bash ./scripts/provision-token-contracts.sh`;

log('Provisioning ColonyToken contracts...')
output = execSync(provisionColonyToken);
log(output.toString())
}

function getFilesToSkip(){
const array = [
'Migrations.sol',
'common/EtherRouter.sol',
'patriciaTree',
'testHelpers',
];

const output = execSync("ls ./**/*Updated*", {cwd: "./contracts/"});

return array.concat(output.toString().split('\n').slice(0,-1))
}

module.exports = {
skipFiles: getFilesToSkip(),
providerOptions: {
port: 8555,
network_id: 1999,
account_keys_path: "./ganache-accounts.json",
vmErrorsOnRPCResponse: false,
total_accounts: 18
},
onCompileComplete: provisionTokenContracts,
istanbulFolder: "./coverage-upgrade"
}

37 changes: 37 additions & 0 deletions contracts/extensions/IColonyExtension.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
This file is part of The Colony Network.

The Colony Network is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

The Colony Network is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with The Colony Network. If not, see <http://www.gnu.org/licenses/>.
*/

pragma solidity 0.7.3;
pragma experimental ABIEncoderV2;
import "./../common/IBasicMetaTransaction.sol";

interface IColonyExtension is IBasicMetaTransaction {

function identifier() external pure returns (bytes32);
function version() external pure virtual returns (uint256);
function install(address _colony) external virtual;
function finishUpgrade() external virtual;
function deprecate(bool _deprecated) external virtual;
function uninstall() external virtual;

function getCapabilityRoles(bytes4 _sig) external view virtual returns (bytes32);

function getDeprecated() external view returns (bool);

function getColony() external view returns(address);

}
Loading