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

bonding, rounds: revert reasons #335

Merged
merged 1 commit into from
Sep 29, 2019
Merged

bonding, rounds: revert reasons #335

merged 1 commit into from
Sep 29, 2019

Conversation

kyriediculous
Copy link
Contributor

What does this pull request do? Explain your changes. (required)
This PR adds revert reasons to the require statements for the upgradeable contracts.

NOTE: tests that use a GenerickMock.sol contract to execute methods in unit tests don't return revert reasons yet, see #333.

NOTE: public view functions seem to not return revert reasons as they are calls and not transactions.

How did you test each of these updates (required)
Adjusted & ran unit and integation tests

Does this pull request close any open issues?
Fixes #313

Checklist:

  • README and other documentation updated
  • All unit & integration tests pass

@yondonfu
Copy link
Member

Mind switching the target branch for this PR to streamflow?

@kyriediculous kyriediculous changed the base branch from expand-active-transcoder-set to streamflow September 23, 2019 02:31
@kyriediculous
Copy link
Contributor Author

Done ! Probably overlapped opening this PR with merging expand-active-transcoder-set into streamflow

@coveralls
Copy link

coveralls commented Sep 23, 2019

Pull Request Test Coverage Report for Build 1128

  • 26 of 26 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 1107: 0.0%
Covered Lines: 683
Relevant Lines: 683

💛 - Coveralls

contracts/bonding/BondingManager.sol Outdated Show resolved Hide resolved
contracts/bonding/BondingManager.sol Outdated Show resolved Hide resolved
test/unit/BondingManager.js Outdated Show resolved Hide resolved
contracts/bonding/BondingManager.sol Outdated Show resolved Hide resolved
test/unit/BondingManager.js Outdated Show resolved Hide resolved
test/unit/RoundsManager.js Outdated Show resolved Hide resolved
@kyriediculous kyriediculous force-pushed the nv/revert-reasons branch 2 times, most recently from 05c4044 to b53e7f1 Compare September 26, 2019 11:29
Copy link
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

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

Changes look good! I left one comment about omitting the -k petersburg flag when starting testrpc-sc. Let's address the comment and then rebase to resolve the merge conflicts. No need for re-review prior to the rebase.

scripts/run_ganache.sh Outdated Show resolved Hide resolved
@kyriediculous
Copy link
Contributor Author

rebased !

@@ -254,19 +253,22 @@ contract("RoundsManager", accounts => {
describe("blockHash", () => {
it("should fail if block is in the future", async () => {
const latestBlock = await web3.eth.getBlockNumber()
await expectThrow(roundsManager.blockHash(latestBlock + 1))
// Note that current block = latestBlock + 1, so latestBlock + 2 is in the future
Copy link
Member

Choose a reason for hiding this comment

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

Actually, the current block number as returned by web3.eth.getBlockNumber() should be equal to latestBlock here since eth_call by default executes in the context of the latest block and not in the context of the pending block to be mined. So, in this case latestBlock + 1 would be a block number in the future.

})

it("should fail if block is the current block", async () => {
const latestBlock = await web3.eth.getBlockNumber()
await expectThrow(roundsManager.blockHash(latestBlock))
// Note that current block = latestBlock + 1
Copy link
Member

Choose a reason for hiding this comment

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

Based on my previous comment, latestBlock would actually be the current block here.

@kyriediculous
Copy link
Contributor Author

kyriediculous commented Sep 29, 2019 via email

Copy link
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

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

LGTM!

@yondonfu yondonfu merged commit 521c054 into streamflow Sep 29, 2019
@yondonfu yondonfu deleted the nv/revert-reasons branch September 29, 2019 23:34
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.

3 participants