From 81823cd0093ba9381d3fd9aef8715aa339dc7c2c Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Sat, 22 Apr 2023 20:13:58 -0500 Subject: [PATCH] Move param definitions to validation pool --- .../src/classes/dao/validation-pool.js | 28 ++++++++++++++++++- forum-network/src/params.js | 28 ------------------- .../tests/scripts/forum/forum.test-util.js | 9 ------ 3 files changed, 27 insertions(+), 38 deletions(-) delete mode 100644 forum-network/src/params.js diff --git a/forum-network/src/classes/dao/validation-pool.js b/forum-network/src/classes/dao/validation-pool.js index 160783b..c46f213 100644 --- a/forum-network/src/classes/dao/validation-pool.js +++ b/forum-network/src/classes/dao/validation-pool.js @@ -1,10 +1,36 @@ import { ReputationHolder } from '../reputation/reputation-holder.js'; import { Stake } from '../supporting/stake.js'; import { Voter } from '../supporting/voter.js'; -import params from '../../params.js'; import { Action } from '../display/action.js'; import { displayNumber } from '../../util/helpers.js'; +const params = { + /* Validation Pool parameters */ + mintingRatio: () => 1, // c1 + // NOTE: c2 overlaps with c3 and adds excess complexity, so we omit it for now + stakeForAuthor: 0.5, // c3 + winningRatio: 0.5, // c4 + quorum: 0, // c5 + activeVoterThreshold: null, // c6 + voteDuration: { + // c7 + min: 0, + max: null, + }, + // NOTE: c8 is the token loss ratio, which is specified as a runtime argument + contentiousDebate: { + period: 5000, // c9 + stages: 3, // c10 + }, + lockingTimeExponent: 0, // c11 + + /* Forum parameters */ + initialPostValue: () => 1, // q1 + revaluationLimit: 1, // q2 + referenceChainLimit: 3, // q3 + leachingValue: 1, // q4 +}; + const ValidationPoolStates = Object.freeze({ OPEN: 'OPEN', CLOSED: 'CLOSED', diff --git a/forum-network/src/params.js b/forum-network/src/params.js deleted file mode 100644 index a9877b7..0000000 --- a/forum-network/src/params.js +++ /dev/null @@ -1,28 +0,0 @@ -const params = { - /* Validation Pool parameters */ - mintingRatio: () => 1, // c1 - // NOTE: c2 overlaps with c3 and adds excess complexity, so we omit it for now - stakeForAuthor: 0.5, // c3 - winningRatio: 0.5, // c4 - quorum: 0, // c5 - activeVoterThreshold: null, // c6 - voteDuration: { - // c7 - min: 0, - max: null, - }, - // NOTE: c8 is the token loss ratio, which is specified as a runtime argument - contentiousDebate: { - period: 5000, // c9 - stages: 3, // c10 - }, - lockingTimeExponent: 0, // c11 - - /* Forum parameters */ - initialPostValue: () => 1, // q1 - revaluationLimit: 1, // q2 - referenceChainLimit: 3, // q3 - leachingValue: 1, // q4 -}; - -export default params; diff --git a/forum-network/src/tests/scripts/forum/forum.test-util.js b/forum-network/src/tests/scripts/forum/forum.test-util.js index 2409d0c..cd8deac 100644 --- a/forum-network/src/tests/scripts/forum/forum.test-util.js +++ b/forum-network/src/tests/scripts/forum/forum.test-util.js @@ -2,7 +2,6 @@ import { Box } from '../../../classes/display/box.js'; import { Scene } from '../../../classes/display/scene.js'; import { Expert } from '../../../classes/actors/expert.js'; import { PostContent } from '../../../classes/supporting/post-content.js'; -import params from '../../../params.js'; import { DAO } from '../../../classes/dao/dao.js'; import { delayOrWait } from '../../../classes/display/controls.js'; @@ -77,14 +76,6 @@ export class ForumTest { scene.withFlowchart(); scene.withTable(); - scene.addDisplayValue('c3. stakeForAuthor').set(params.stakeForAuthor); - scene.addDisplayValue('q2. revaluationLimit').set(params.revaluationLimit); - scene - .addDisplayValue('q3. referenceChainLimit') - .set(params.referenceChainLimit); - scene.addDisplayValue('q4. leachingValue').set(params.leachingValue); - scene.addDisplayValue(' '); - // If we're going to announce experts, announce the DAO so it appears first. this.dao = new DAO('DAO', scene, { announce: this.options.displayAuthors }); this.forum = this.dao.forum;