[WIP] Solidity contracts tests #106

Closed
haythem96 wants to merge 17 commits from tests/contracts into master
Showing only changes of commit ab6d6a4025 - Show all commits

View File

@@ -111,7 +111,7 @@ contract('Contributor app', (accounts) => {
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
id = await contributor.coreContributorsCount();
oldAccount = root;
newAccount = member1;
hashDigest = '0x1';
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
hashDigest = '0x1000000000000000000000000000000000000000000000000000000000000000';
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
hashFunction = 1;
hashSize = 1;
});
@@ -145,8 +145,10 @@ contract('Contributor app', (accounts) => {
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
it('update contributor profile hash', async() => {
await contributor.updateContributorProfileHash(id.toNumber(), hashDigest, hashFunction, hashSize);
let contributorId = await contributor.getContributorIdByAddress(oldAccount);
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
assert.equal(contributorId.toNumber(), 0);
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
let contributorProfile = await contributor.contributors(id.toNumber());
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
assert.equal(hashDigest, contributorProfile[1]);
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
assert.equal(hashFunction, contributorProfile[2].toNumber());
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
assert.equal(hashSize, contributorProfile[3].toNumber());
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
});
it("should revert when update contributor profile hash from address that does not have permission", async() => {
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
raucao commented 2019-04-19 08:58:19 +00:00 (Migrated from github.com)
Review

This doesn't actually check for an updated hash afaics.

This doesn't actually check for an updated hash afaics.
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)
haythem96 commented 2019-04-20 14:32:32 +00:00 (Migrated from github.com)
Review

yup...solved in this commit

yup...solved in this [commit](https://github.com/67P/kredits-contracts/pull/106/commits/ab6d6a40251a9589d99886b0e53bb86b74f50080)