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 Solidity unit tests for SafeMath library #4

Open
4 tasks
vbaranov opened this issue Nov 26, 2018 · 9 comments
Open
4 tasks

Add Solidity unit tests for SafeMath library #4

vbaranov opened this issue Nov 26, 2018 · 9 comments

Comments

@vbaranov
Copy link
Contributor

Child of #1

  • mul func
  • div func
  • sub func
  • add func
@vbaranov
Copy link
Contributor Author

@varasev btw, why not the Open Zeppelin's implementation of Safemath lib is used? At least, it is not the latest one.

@varasev
Copy link
Collaborator

varasev commented Nov 26, 2018

@vbaranov I took the implementation from our consensus contracts and didn't check if Open Zeppelin contained a new version. Thanks for reminding - I'll update that.

@varasev
Copy link
Collaborator

varasev commented Nov 27, 2018

SafeMath was updated in d7c14b2.

@DemiMarie
Copy link
Contributor

Can this be closed? The OpenZeppelin implementation is heavily tested, so testing it further would not be a good use of our efforts. (It would not be pointless ― just a poor use of POA Network resources.)

@DemiMarie
Copy link
Contributor

@varasev @vbaranov

@vbaranov
Copy link
Contributor Author

@DemiMarie

The OpenZeppelin implementation is heavily tested

That's true.

It would not be pointless ― just a poor use of POA Network resources.

I agree with this too. And we don't need to invent a bicycle. We can get those tests to our repo.

I think that every contract in the dPoS set should be covered with unit tests. There are two ways to add SafeMath lib tests:

  1. or we can add SafeMathLib by adding openzeppelin-solidity npm package (thus, we will automatically get the unit tests for it)
  2. or we can copy SafeMathLib unit tests to our repo.

In both cases we don't need so much resources.

@DemiMarie @varasev which one do you prefer (if any)?

@varasev
Copy link
Collaborator

varasev commented Jan 24, 2019

I'm working on unit tests. Let me do this because I'm the only developer at the moment who designed and wrote each function of pos contracts from scratch, there are many nuances and details that are known only to me.

As of SafeMath lib - I'll copy them from openzeppelin-solidity.

@DemiMarie
Copy link
Contributor

@varasev status?

@varasev
Copy link
Collaborator

varasev commented Mar 4, 2019

Isn't done yet. I was busy doing the changes in the contracts, reviewing White Paper and design layouts.

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

No branches or pull requests

3 participants