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

Test Improvements #4

Merged
6 commits merged into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@ Please make sure to read the README mentioned in the scripts folder before runni
- Total unique wallets participated in all tiers. Currently only unique wallets participated in a each tier is counted, which is not the same as unique wallets participated in all tiers combined. New storage structure will be required.
- Tests related to other type of sales to be added.
- Reduce the reason string text size, or use a numbering system with errors in mainly LockedFund and OriginsBase.
- `saleEndDurationOrTS` in OriginsBase has little upside for storing and might be removable in the future.
1 change: 1 addition & 0 deletions contracts/LockedFund.sol
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ contract LockedFund is ILockedFund {
*/
function withdrawAndStakeTokens(address _receiverAddress) external {
_withdrawWaitedUnlockedBalance(msg.sender, _receiverAddress);
// TODO: Withdraw Unlocked Balances as well.
_createVestingAndStake(msg.sender);
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "origins-launchpad",
"version": "1.2.8",
"version": "1.2.9",
"description": "The smart contracts for the Origins Platform",
"keywords": [
"Origins",
Expand Down
8 changes: 2 additions & 6 deletions tests/LockedFund/admin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const {
randomValue,
currentTimestamp,
createStakeAndVest,
createLockedFund,
// Contract Artifacts
Token,
LockedFund,
VestingRegistry,
} = require("../utils");

Expand All @@ -32,11 +32,9 @@ contract("LockedFund (Admin Functions)", (accounts) => {

// Creating the Staking and Vesting
[staking, vestingLogic, vestingRegistry] = await createStakeAndVest(creator, token);
});

beforeEach("Creating New Locked Fund Contract Instance.", async () => {
// Creating the instance of LockedFund Contract.
lockedFund = await LockedFund.new(waitedTS, token.address, vestingRegistry.address, [admin], { from: creator });
lockedFund = await createLockedFund(waitedTS, token, vestingRegistry, [admin], creator);

// Adding lockedFund as an admin in the Vesting Registry.
await vestingRegistry.addAdmin(lockedFund.address, { from: creator });
Expand All @@ -51,12 +49,10 @@ contract("LockedFund (Admin Functions)", (accounts) => {
});

it("Admin should not be able to add another admin more than once.", async () => {
await lockedFund.addAdmin(newAdmin, { from: admin });
await expectRevert(lockedFund.addAdmin(newAdmin, { from: admin }), "LockedFund: Address is already admin.");
});

it("Admin should be able to remove an admin.", async () => {
await lockedFund.addAdmin(newAdmin, { from: admin });
await lockedFund.removeAdmin(newAdmin, { from: admin });
});

Expand Down
5 changes: 2 additions & 3 deletions tests/LockedFund/creator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
randomValue,
currentTimestamp,
createStakeAndVest,
createLockedFund,
// Contract Artifacts
Token,
LockedFund,
Expand All @@ -32,11 +33,9 @@ contract("LockedFund (Creator Functions)", (accounts) => {

// Creating the Staking and Vesting
[staking, vestingLogic, vestingRegistry] = await createStakeAndVest(creator, token);
});

beforeEach("Creating New Locked Fund Contract Instance.", async () => {
// Creating the instance of LockedFund Contract.
lockedFund = await LockedFund.new(waitedTS, token.address, vestingRegistry.address, [admin], { from: creator });
lockedFund = await createLockedFund(waitedTS, token, vestingRegistry, [admin], creator);

// Adding lockedFund as an admin in the Vesting Registry.
await vestingRegistry.addAdmin(lockedFund.address, { from: creator });
Expand Down
Loading