Skip to content

Commit

Permalink
Merge pull request #106 from SurfingNerd/i95-improved-test-params
Browse files Browse the repository at this point in the history
improved test params for auto restake test
  • Loading branch information
SurfingNerd authored Jun 4, 2024
2 parents f8a96c6 + b0053bf commit 0f2214e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"localnet-blockscout-fresh": "cd testnet/blockscout-local && docker compose down && docker compose up",
"localnet-fresh-new": "export STAKING_TRANSITION_WINDOW_LENGTH=120 && VALIDATOR_INACTIVITY_THRESHOLD=307584000 && export STAKING_EPOCH_DURATION=432 && export MINIMUM_BLOCK_TIME=1 && export MAXIMUM_BLOCK_TIME=240 && ts-node ./src/localnet/runCreateTestnet.ts",
"localnet-fresh-test-early-epoch-end": "export STAKING_TRANSITION_WINDOW_LENGTH=240 && VALIDATOR_INACTIVITY_THRESHOLD=1209600 && export STAKING_EPOCH_DURATION=60000 && export MINIMUM_BLOCK_TIME=1 && export MAXIMUM_BLOCK_TIME=30 && ts-node ./src/localnet/runCreateTestnet.ts --network=nodes-local-test-early-epoch-end",
"localnet-fresh-auto-restake": "export STAKING_TRANSITION_WINDOW_LENGTH=240 && VALIDATOR_INACTIVITY_THRESHOLD=1209600 && export STAKING_EPOCH_DURATION=600 && export MINIMUM_BLOCK_TIME=1 && export MAXIMUM_BLOCK_TIME=10 && ts-node ./src/localnet/runCreateTestnet.ts --network=nodes-local-test-auto-restake",
"localnet-fresh-auto-restake": "export STAKING_TRANSITION_WINDOW_LENGTH=240 && VALIDATOR_INACTIVITY_THRESHOLD=1209600 && export STAKING_EPOCH_DURATION=600 && export MINIMUM_BLOCK_TIME=10 && export MAXIMUM_BLOCK_TIME=30 && ts-node ./src/localnet/runCreateTestnet.ts --network=nodes-local-test-auto-restake",
"localnet-create-mnemonic": "ts-node src/localnet/create-random-mnemonic.ts",
"localnet-start-phonix-test": "ts-node src/localnet/tests/runPhoenixTestNetwork.ts",
"localnet-test-early-epoch-end-test": "ts-node src/localnet/tests/runEarlyEpochEndTestNetwork.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/localnet/tests/runAutoRestakeTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AutoRestakeTest {

///public totalDelegatorsCount = 0;

public async runTest() {
public async runTest(numOfDelegatorsEachEpoch: number = 1000) {

console.log("Booting testnetwork for automatic restaking test.");
console.log("Tests and documents the implication of the automatic reward restaking feature https://github.com/DMDcoin/diamond-contracts-core/issues/43");
Expand Down Expand Up @@ -122,7 +122,7 @@ class AutoRestakeTest {
let minStake = await contractManager.getMinStake();

let totalDelegatorsCount = 0;
let numOfDelegatorsEachEpoch = 100;


let stakingContract = await contractManager.getStakingHbbft();

Expand All @@ -146,6 +146,7 @@ class AutoRestakeTest {

if (isWorkingOnDelegateStaking) {
console.log("ERROR: already working on delegate staking, Network overload ? error ?");
shutdown();
process.exit(1);
}

Expand Down

0 comments on commit 0f2214e

Please sign in to comment.