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

Migration of Staked Tokens Projects #75

Open
lukestokes opened this issue Feb 26, 2020 · 2 comments
Open

Migration of Staked Tokens Projects #75

lukestokes opened this issue Feb 26, 2020 · 2 comments
Assignees

Comments

@lukestokes
Copy link
Contributor

Michael made a stake and transfer function to handle this.
Michael to check with dallas for proper tests for members who are voting to members who are not voting and all the new stake stuff is working as expected.

@dallasjohnson
Copy link
Contributor

I have added tests for the staking from here

context('Staking', async () => {
and tests here
context('stakeobsv', async () => {
let dacId = 'stakeobsdac';
let lockedCandidateToUnstake: Account;
before(async () => {
await shared.initDac(dacId, '4,OBSDAC', '1000000.0000 OBSDAC');
await shared.updateconfig(dacId, '12.0000 OBSDAC');
await shared.dac_token_contract.stakeconfig(
{ enabled: true, min_stake_time: 5, max_stake_time: 20 },
'4,OBSDAC',
{ from: shared.auth_account }
);
let regMembers = await shared.getRegMembers(dacId, '20000.0000 OBSDAC');
let candidates = await shared.getStakeObservedCandidates(
dacId,
'12.0000 OBSDAC'
);
lockedCandidateToUnstake = candidates[3];
await shared.voteForCustodians(regMembers, candidates, dacId);
await shared.daccustodian_contract.newperiode(
'initial new period',
dacId,
{
from: regMembers[0], // Could be run by anyone.
}
);
await shared.updateconfig(dacId, '14.0000 OBSDAC');
});
context(
'with candidate in a registered candidate locked time',
async () => {
context('with less than the locked up quantity staked', async () => {
it('should fail to unstake', async () => {
await assertEOSErrorIncludesMessage(
shared.dac_token_contract.unstake(
lockedCandidateToUnstake.name,
'10.0000 OBSDAC',
{ from: lockedCandidateToUnstake }
),
'CANNOT_UNSTAKE'
);
});
});
}
);
});
. Also since the staked candidates are needed repeatedly throughout the tests suite they are set up in the TestHelpers.ts common file here
await debugPromise(
this.dac_token_contract.stake(candidate.name, dacStakeAsset, {
from: candidate,
}),
'staking for candidate'

@michaeljyeates
Copy link
Contributor

can you add tests where staking is not enabled on the token contract?

@dallasjohnson dallasjohnson removed their assignment Apr 14, 2020
dallasjohnson pushed a commit that referenced this issue Feb 5, 2024
…t-Enable-numeric-checks

Stakevote contract enable numeric checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants