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 reputation staking in gas cost test #179

Merged
merged 4 commits into from
Mar 20, 2018
Merged

Add reputation staking in gas cost test #179

merged 4 commits into from
Mar 20, 2018

Conversation

laurentsenta
Copy link
Contributor

Closes #173

@elenadimitrova
Copy link
Contributor

Change all stacking to staking, they mean different things in English.

@laurentsenta
Copy link
Contributor Author

Typo fixed, thanks for the note.

I added the measure for the hash submission process.

@elenadimitrova elenadimitrova changed the title Add reputation stacking in gas cost test Add reputation staking in gas cost test Mar 14, 2018
@elenadimitrova
Copy link
Contributor

There seems to be an issue with gas cost reports for ReputationMiningCycle contract, logged here
cgewecke/eth-gas-reporter#64

@elenadimitrova
Copy link
Contributor

@lsenta can you have a look at the suggested fix in issue above and see if you can coerce ReputationMiningCycle to show its gas costs?

Before we wouldn't get gas costs for calls on the
ReputationMiningCycle contract.

Workaround is:

- give it its own file
- require it before the tests starts (in migrations/)

related issue: cgewecke/eth-gas-reporter#64
@laurentsenta
Copy link
Contributor Author

@elenadimitrova I implemented the following fixes and it's working:

  • give the contract it's own file,
  • require it during migration,
  • exclude it from the check-storage script.

The last one was a "just get it done" fix, let me know if we want to refactor the smart contract instead (I'll open a ticket).



}
// TODO: Can we handle a dispute regarding the very first hash that should be set?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is in ReputationMiningCycle contract already. Does it need to be here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad copy and paste, I'll put it at the top of the network staking contract since it's feature related.

// preparation. We need this for the eth-gas-reporter.
// See https://github.com/cgewecke/eth-gas-reporter/issues/64
// This log prevents "variable not used" warnings.
console.log(ReputationMiningCycle);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we disable "variable not used" here instead of logging the contract. That will be a very messy console output.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, we don't even need a variable... force of habit!

@@ -12,7 +12,8 @@ fs.readdirSync("./contracts/").forEach(contractName => {
"EtherRouter.sol",
"Migrations.sol",
"Resolver.sol",
"Token.sol"
"Token.sol",
"ReputationMiningCycle.sol"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to include it here as this is not an EternalStorage-based contract

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build broke without it:
https://circleci.com/gh/JoinColony/colonyNetwork/1119

From what I understand:
We want to avoid state defined in contract that inherit from ColonyNetworkStorage. That's a way to centralize all the state in the ColonyNetworkStorage definition,
right?

If that's the case we might need to check the inheritance hierarchy in the check-storage.js script.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry the diff was hiding the part that this is an exclusion list. You've correctly excluded it, my bad.

@elenadimitrova elenadimitrova merged commit ab9fed1 into JoinColony:develop Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants