-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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 unit test specific to Address utils (#1251) #1316
Add unit test specific to Address utils (#1251) #1316
Conversation
8e25139
to
2b1c8c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a big one @jbogacz, thanks! Looks like this was only indirectly tested in the ERC721 tests.
contracts/mocks/AddressImpl.sol
Outdated
@@ -0,0 +1,14 @@ | |||
pragma solidity ^0.4.24; | |||
|
|||
import "../../contracts/utils/Address.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace for import "../utils/Address.sol";
(see #1321)
contracts/mocks/AddressImpl.sol
Outdated
{ | ||
return Address.isContract(account); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can you add a newline at the end here? Not sure why the linter doesn't catch this
test/Address.test.js
Outdated
require('chai') | ||
.should(); | ||
|
||
contract('Address', function ([_, creator]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd rename creator
to anyone
, since we don't really need a creator here.
test/Address.test.js
Outdated
}); | ||
|
||
it('should return false for account address', async function () { | ||
const isContract = await this.mock.isContract(creator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you replace this (and the other test) for (await this.mock.isContract(creator)).should.equal(false);
? See #1216
test/Address.test.js
Outdated
}); | ||
|
||
it('should return true for contract address', async function () { | ||
const contract = await SimpleToken.new({ from: creator }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This from: creator
isn't really needed, why is why I suggested the rename, and removing this bit (to avoid unnecessary confusion about a creator address) :)
2b1c8c6
to
2ac55f8
Compare
@nventuro be my guest :) I need some time to learn OZ flavors but I'm determined :) Anyway, I've fixed your review comments. I've squashed my commits and --force pushed to my branch - hope it's fine with OZ policy |
2ac55f8
to
e297281
Compare
I'm not sure what happened why 'static test' failed with message 'No output has been received in the last 10m0s'. Does it mean that job maximum 10 minutes was reached and Travis killed it automatically? If so, could you @nventuro kick it again, please? |
e297281
to
9564234
Compare
@jbogacz I've seen that happen in a couple suite runs, not sure if there's something wrong with our suite (e.g. a missing Regarding reviews, it's usually better to simply add commits on top, since we squash before merging anyway, and it makes reviewing easier, but for small PRs like this one it's fine either way :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @jbogacz, thanks a lot!
hell yeah! thanks! |
🚀 Description
npm run lint:all:fix
).