Browse Source

network-tests: initial refactor complete

Mokhtar Naamani 4 years ago
parent
commit
b13bf90ea3

+ 2 - 4
tests/network-tests/package.json

@@ -5,11 +5,10 @@
   "scripts": {
     "build": "tsc --noEmit",
     "run-tests": "./run-tests.sh",
-    "test-run": "yarn db-path-setup && node -r ts-node/register --unhandled-rejections=strict",
+    "test-run": "node -r ts-node/register --unhandled-rejections=strict",
     "lint": "eslint . --quiet --ext .ts",
     "checks": "tsc --noEmit --pretty && prettier ./ --check && yarn lint",
-    "format": "prettier ./ --write ",
-    "db-path-setup": "mkdir .tmp/ || rm .tmp/db.json || echo ''"
+    "format": "prettier ./ --write "
   },
   "dependencies": {
     "@joystream/types": "link:../../types",
@@ -22,7 +21,6 @@
     "bn.js": "^4.11.8",
     "dotenv": "^8.2.0",
     "fs": "^0.0.1-security",
-    "lowdb": "^1.0.0",
     "uuid": "^7.0.3"
   },
   "devDependencies": {

+ 10 - 3
tests/network-tests/src/Api.ts

@@ -49,7 +49,7 @@ export class Api {
     let connectAttempts = 0
     while (true) {
       connectAttempts++
-      debug('Connecting to chain..')
+      debug(`Connecting to chain, attempt ${connectAttempts}..`)
       try {
         const api = await ApiPromise.create({ provider, types })
 
@@ -66,7 +66,6 @@ export class Api {
           throw new Error('Unable to connect to chain')
         }
       }
-      debug(`Retrying to connecting to chain, attempt ${connectAttempts}..`)
       await Utils.wait(5000)
     }
   }
@@ -898,13 +897,14 @@ export class Api {
     }
   }
 
-  public expectWorkerRewardAmountUpdatedEvent(events: EventRecord[]): void {
+  public expectWorkerRewardAmountUpdatedEvent(events: EventRecord[]): WorkerId {
     const record = events.find(
       (record) => record.event.method && record.event.method.toString() === 'WorkerRewardAmountUpdated'
     )
     if (!record) {
       throw new Error('Expected Event Not Found')
     }
+    return (record.event.data[0] as unknown) as WorkerId
   }
 
   public expectStakeDecreasedEvent(events: EventRecord[]): void {
@@ -1880,6 +1880,13 @@ export class Api {
     return this.api.query.recurringRewards.rewardRelationships<RewardRelationship>(id)
   }
 
+  public async getWorkerRewardRelationship(workerId: WorkerId, module: WorkingGroups): Promise<RewardRelationship> {
+    const rewardRelationshipId: RewardRelationshipId = (
+      await this.getWorkerById(workerId, module)
+    ).reward_relationship.unwrap()
+    return this.getRewardRelationship(rewardRelationshipId)
+  }
+
   public async getWorkerRewardAccount(workerId: WorkerId, module: WorkingGroups): Promise<string> {
     const rewardRelationshipId: RewardRelationshipId = (
       await this.getWorkerById(workerId, module)

+ 0 - 89
tests/network-tests/src/DbService.ts

@@ -1,89 +0,0 @@
-import lowdb from 'lowdb/lib/main'
-import FileSync from 'lowdb/adapters/FileSync'
-import { KeyringPair, KeyringPair$Json } from '@polkadot/keyring/types'
-import Keyring from '@polkadot/keyring'
-import BN from 'bn.js'
-
-export class DbService {
-  private static instance: DbService
-
-  private adapter: any
-  private db: any
-  private keyring: Keyring
-  private dbPath: string
-
-  private static MEMBERS_KEY = 'members'
-  private static COUNCIL_KEY = 'council'
-  private static LEADER_KEY = 'leader'
-
-  private constructor() {
-    this.keyring = new Keyring({ type: 'sr25519' })
-    this.dbPath = process.env.DB_PATH!
-    this.adapter = new FileSync(this.dbPath)
-    this.db = lowdb(this.adapter)
-  }
-
-  public static getInstance(): DbService {
-    if (!DbService.instance) {
-      DbService.instance = new DbService()
-    }
-    return DbService.instance
-  }
-
-  public setCouncil(council: KeyringPair[]): void {
-    council.forEach((keyPair, index) => {
-      this.db.set(`${DbService.COUNCIL_KEY}.${index}`, keyPair.toJson()).write()
-    })
-  }
-
-  public getCouncil(): KeyringPair[] {
-    const council: KeyringPair[] = []
-    const jsonKeyringPairs: KeyringPair$Json[] = this.db.get(DbService.COUNCIL_KEY).value()
-    jsonKeyringPairs.forEach((jsonKeyringPair) => {
-      const keyPair: KeyringPair = this.keyring.addFromJson(jsonKeyringPair)
-      keyPair.decodePkcs8()
-      council.push(keyPair)
-    })
-    return council
-  }
-
-  public hasCouncil(): boolean {
-    return this.db.has(DbService.COUNCIL_KEY).value()
-  }
-
-  public setMembers(members: KeyringPair[]): void {
-    members.forEach((keyPair, index) => {
-      this.db.set(`${DbService.MEMBERS_KEY}.${index}`, keyPair.toJson()).write()
-    })
-  }
-
-  public getMembers(): KeyringPair[] {
-    const members: KeyringPair[] = []
-    const jsonKeyringPairs: KeyringPair$Json[] = this.db.get(DbService.MEMBERS_KEY).value()
-    jsonKeyringPairs.forEach((jsonKeyringPair) => {
-      const keyPair: KeyringPair = this.keyring.addFromJson(jsonKeyringPair)
-      keyPair.decodePkcs8()
-      members.push(keyPair)
-    })
-    return members
-  }
-
-  public hasMembers(): boolean {
-    return this.db.has(DbService.MEMBERS_KEY).value()
-  }
-
-  public setLeader(leader: KeyringPair, workingGroup: string): void {
-    this.db.set(`${workingGroup}.${DbService.LEADER_KEY}`, leader.toJson()).write()
-  }
-
-  public getLeader(workingGroup: string): KeyringPair {
-    const jsonKeyringPair: KeyringPair$Json = this.db.get(`${workingGroup}.${DbService.LEADER_KEY}`).value()
-    const keyPair: KeyringPair = this.keyring.addFromJson(jsonKeyringPair)
-    keyPair.decodePkcs8()
-    return keyPair
-  }
-
-  public hasLeader(workingGroup: string): boolean {
-    return this.db.has(`${workingGroup}.${DbService.LEADER_KEY}`).value()
-  }
-}

+ 7 - 1
tests/network-tests/src/fixtures/workingGroupModule.ts

@@ -322,6 +322,7 @@ export class FillOpeningFixture implements Fixture {
   private payoutInterval: BN
   private amountPerPayout: BN
   private module: WorkingGroups
+  private workerIds: WorkerId[] = []
 
   constructor(
     api: Api,
@@ -341,6 +342,10 @@ export class FillOpeningFixture implements Fixture {
     this.module = module
   }
 
+  public getWorkerIds(): WorkerId[] {
+    return this.workerIds
+  }
+
   public async runner(expectFailure: boolean): Promise<void> {
     const lead = await this.api.getGroupLead(this.module)
     if (!lead) {
@@ -363,7 +368,6 @@ export class FillOpeningFixture implements Fixture {
 
     // Fill worker opening
     const now: BN = await this.api.getBestBlock()
-
     const result = await this.api.fillOpening(
       leadAccount,
       this.openingId,
@@ -374,6 +378,8 @@ export class FillOpeningFixture implements Fixture {
       this.module
     )
     const applicationIdToWorkerIdMap: ApplicationIdToWorkerIdMap = this.api.expectOpeningFilledEvent(result.events)
+    this.workerIds = []
+    applicationIdToWorkerIdMap.forEach((workerId) => this.workerIds.push(workerId))
 
     // Assertions
     applicationIdToWorkerIdMap.forEach(async (workerId, applicationId) => {

+ 14 - 9
tests/network-tests/src/flows/proposals/manageLeaderRole.ts

@@ -1,5 +1,3 @@
-import { KeyringPair } from '@polkadot/keyring/types'
-import { Keyring } from '@polkadot/api'
 import BN from 'bn.js'
 import { Api, WorkingGroups } from '../../Api'
 import { BuyMembershipHappyCaseFixture } from '../../fixtures/membershipModule'
@@ -114,24 +112,28 @@ export default async function manageLeaderRole(api: Api, env: NodeJS.ProcessEnv,
   // Approve fill leader opening
   await voteForFillLeaderProposalFixture.runner(false)
 
+  const hiredLead = await api.getGroupLead(group)
+  assert(hiredLead)
+
   const setLeaderRewardProposalFixture = new SetLeaderRewardProposalFixture(api, proposer, alteredPayoutAmount, group)
   // Propose leader reward
   await setLeaderRewardProposalFixture.runner(false)
 
-  const voteForeLeaderRewardFixture: VoteForProposalFixture = new VoteForProposalFixture(
+  const voteForeLeaderRewardFixture = new VoteForProposalFixture(
     api,
     setLeaderRewardProposalFixture.getCreatedProposalId() as ProposalId
   )
 
-  // const expectLeaderRewardAmountUpdatedFixture = new ExpectLeaderRewardAmountUpdatedFixture(
-  //   api,
-  //   alteredPayoutAmount,
-  //   group
-  // )
-
   // Approve new leader reward
   await voteForeLeaderRewardFixture.runner(false)
 
+  const leadId = await api.getLeadWorkerId(group)
+  // This check is prone to failure if more than one worker's reward amount was updated
+  const workerId = api.expectWorkerRewardAmountUpdatedEvent(voteForeLeaderRewardFixture.getEvents())
+  assert(leadId!.eq(workerId))
+  const rewardRelationship = await api.getWorkerRewardRelationship(leadId!, group)
+  assert(rewardRelationship.amount_per_payout.eq(alteredPayoutAmount))
+
   const decreaseLeaderStakeProposalFixture = new DecreaseLeaderStakeProposalFixture(
     api,
     proposer,
@@ -171,4 +173,7 @@ export default async function manageLeaderRole(api: Api, env: NodeJS.ProcessEnv,
     terminateLeaderRoleProposalFixture.getCreatedProposalId() as ProposalId
   )
   await voteForLeaderRoleTerminationFixture.runner(false)
+
+  const maybeLead = await api.getGroupLead(group)
+  assert(!maybeLead)
 }

+ 3 - 5
tests/network-tests/src/flows/proposals/updateRuntime.ts

@@ -1,13 +1,11 @@
 import BN from 'bn.js'
 import { Api } from '../../Api'
-import { Utils } from '../../utils'
 import { BuyMembershipHappyCaseFixture } from '../../fixtures/membershipModule'
 import { UpdateRuntimeFixture } from '../../fixtures/proposalsModule'
 import { PaidTermId } from '@joystream/types/members'
-import { DbService } from '../../DbService'
 import { assert } from 'chai'
 
-export default async function updateRuntime(api: Api, env: NodeJS.ProcessEnv, db: DbService) {
+export default async function updateRuntime(api: Api, env: NodeJS.ProcessEnv) {
   const paidTerms: PaidTermId = api.createPaidTermId(new BN(+env.MEMBERSHIP_PAID_TERMS!))
   const runtimePath: string = env.RUNTIME_WASM_PATH!
 
@@ -21,10 +19,10 @@ export default async function updateRuntime(api: Api, env: NodeJS.ProcessEnv, db
   await updateRuntimeFixture.runner(false)
 
   // Some tests after runtime update
-  const thirdMemberSetFixture: BuyMembershipHappyCaseFixture = new BuyMembershipHappyCaseFixture(
+  const createMembershipsFixture = new BuyMembershipHappyCaseFixture(
     api,
     api.createKeyPairs(1).map((key) => key.address),
     paidTerms
   )
-  await thirdMemberSetFixture.runner(false)
+  await createMembershipsFixture.runner(false)
 }

+ 42 - 70
tests/network-tests/src/flows/workingGroup/manageWorkerAsLead.ts

@@ -1,6 +1,4 @@
 import { Api, WorkingGroups } from '../../Api'
-import { Keyring } from '@polkadot/api'
-import { KeyringPair } from '@polkadot/keyring/types'
 import {
   ApplyForOpeningFixture,
   AddWorkerOpeningFixture,
@@ -10,21 +8,15 @@ import {
   SlashFixture,
   TerminateRoleFixture,
 } from '../../fixtures/workingGroupModule'
-import { Utils } from '../../utils'
+import { BuyMembershipHappyCaseFixture } from '../../fixtures/membershipModule'
 import BN from 'bn.js'
 import { OpeningId } from '@joystream/types/hiring'
-import { DbService } from '../../DbService'
 import { assert } from 'chai'
+import Debugger from 'debug'
 
 // Manage worker as lead scenario
-export default async function manageWorker(api: Api, env: NodeJS.ProcessEnv, db: DbService, group: WorkingGroups) {
-  const sudoUri: string = env.SUDO_ACCOUNT_URI!
-  const keyring = new Keyring({ type: 'sr25519' })
-  const sudo: KeyringPair = keyring.addFromUri(sudoUri)
-
-  // const N: number = +env.WORKING_GROUP_N!
-  const leadKeyPair: KeyringPair[] = Utils.createKeyPairs(keyring, 1)
-
+export default async function manageWorker(api: Api, env: NodeJS.ProcessEnv, group: WorkingGroups) {
+  const debug = Debugger(`manageWorker:${group}`)
   const applicationStake: BN = new BN(env.WORKING_GROUP_APPLICATION_STAKE!)
   const roleStake: BN = new BN(env.WORKING_GROUP_ROLE_STAKE!)
   const firstRewardInterval: BN = new BN(env.LONG_REWARD_INTERVAL!)
@@ -32,16 +24,17 @@ export default async function manageWorker(api: Api, env: NodeJS.ProcessEnv, db:
   const payoutAmount: BN = new BN(env.PAYOUT_AMOUNT!)
   const unstakingPeriod: BN = new BN(env.STORAGE_WORKING_GROUP_UNSTAKING_PERIOD!)
   const openingActivationDelay: BN = new BN(0)
+  const paidTerms = api.createPaidTermId(new BN(+env.MEMBERSHIP_PAID_TERMS!))
 
-  assert(db.hasLeader(api.getWorkingGroupString(group)))
-  const nKeyPairs = db.getMembers()
-  leadKeyPair[0] = db.getLeader(api.getWorkingGroupString(group))
+  const lead = await api.getGroupLead(group)
+  assert(lead)
+
+  const applicants = api.createKeyPairs(5).map((key) => key.address)
+  const memberSetFixture = new BuyMembershipHappyCaseFixture(api, applicants, paidTerms)
+  await memberSetFixture.runner(false)
 
   const addWorkerOpeningFixture: AddWorkerOpeningFixture = new AddWorkerOpeningFixture(
     api,
-    nKeyPairs,
-    leadKeyPair[0],
-    sudo,
     applicationStake,
     roleStake,
     openingActivationDelay,
@@ -51,72 +44,51 @@ export default async function manageWorker(api: Api, env: NodeJS.ProcessEnv, db:
   // Add worker opening
   await addWorkerOpeningFixture.runner(false)
 
-  let applyForWorkerOpeningFixture: ApplyForOpeningFixture
   // First apply for worker opening
-  await (async () => {
-    applyForWorkerOpeningFixture = new ApplyForOpeningFixture(
-      api,
-      nKeyPairs,
-      sudo,
-      applicationStake,
-      roleStake,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await applyForWorkerOpeningFixture.runner(false)
-  })()
+  const applyForWorkerOpeningFixture = new ApplyForOpeningFixture(
+    api,
+    applicants,
+    applicationStake,
+    roleStake,
+    addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
+    group
+  )
+  await applyForWorkerOpeningFixture.runner(false)
+  debug('Applications:', applyForWorkerOpeningFixture.getApplicationIds())
+  const applicationIdsToHire = applyForWorkerOpeningFixture.getApplicationIds().slice(0, 2)
 
-  let beginApplicationReviewFixture: BeginApplicationReviewFixture
   // Begin application review
-  await (async () => {
-    beginApplicationReviewFixture = new BeginApplicationReviewFixture(
-      api,
-      leadKeyPair[0],
-      sudo,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await beginApplicationReviewFixture.runner(false)
-  })()
+  const beginApplicationReviewFixture = new BeginApplicationReviewFixture(
+    api,
+    addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
+    group
+  )
+  await beginApplicationReviewFixture.runner(false)
 
-  let fillOpeningFixture: FillOpeningFixture
+  debug('Filling with ids:', applicationIdsToHire)
   // Fill worker opening
-  await (async () => {
-    fillOpeningFixture = new FillOpeningFixture(
-      api,
-      nKeyPairs,
-      leadKeyPair[0],
-      sudo,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      firstRewardInterval,
-      rewardInterval,
-      payoutAmount,
-      group
-    )
-    await fillOpeningFixture.runner(false)
-  })()
-
-  const decreaseStakeFixture: DecreaseStakeFixture = new DecreaseStakeFixture(
+  const fillOpeningFixture = new FillOpeningFixture(
     api,
-    nKeyPairs,
-    leadKeyPair[0],
-    sudo,
+    applicationIdsToHire,
+    addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
+    firstRewardInterval,
+    rewardInterval,
+    payoutAmount,
     group
   )
+  await fillOpeningFixture.runner(false)
+  debug('Hired worker ids', fillOpeningFixture.getWorkerIds())
+  const firstWorkerId = fillOpeningFixture.getWorkerIds()[0]
+
+  const decreaseStakeFixture = new DecreaseStakeFixture(api, firstWorkerId, group)
   // Decrease worker stake
   await decreaseStakeFixture.runner(false)
 
-  const slashFixture: SlashFixture = new SlashFixture(api, nKeyPairs, leadKeyPair[0], sudo, group)
+  const slashFixture: SlashFixture = new SlashFixture(api, firstWorkerId, group)
   // Slash worker
   await slashFixture.runner(false)
 
-  const terminateRoleFixture: TerminateRoleFixture = new TerminateRoleFixture(
-    api,
-    nKeyPairs,
-    leadKeyPair[0],
-    sudo,
-    group
-  )
+  const terminateRoleFixture = new TerminateRoleFixture(api, firstWorkerId, group)
 
   // Terminate workers
   await terminateRoleFixture.runner(false)

+ 43 - 77
tests/network-tests/src/flows/workingGroup/manageWorkerAsWorker.ts

@@ -1,6 +1,4 @@
 import { Api, WorkingGroups } from '../../Api'
-import { Keyring } from '@polkadot/api'
-import { KeyringPair } from '@polkadot/keyring/types'
 import {
   AddWorkerOpeningFixture,
   ApplyForOpeningFixture,
@@ -9,24 +7,13 @@ import {
   IncreaseStakeFixture,
   UpdateRewardAccountFixture,
 } from '../../fixtures/workingGroupModule'
-import { Utils } from '../../utils'
 import BN from 'bn.js'
 import { OpeningId } from '@joystream/types/hiring'
-import { DbService } from '../../DbService'
+import { BuyMembershipHappyCaseFixture } from '../../fixtures/membershipModule'
 import { assert } from 'chai'
 
 // Manage worker as worker
-export default async function manageWorkerAsWorker(
-  api: Api,
-  env: NodeJS.ProcessEnv,
-  db: DbService,
-  group: WorkingGroups
-) {
-  const sudoUri: string = env.SUDO_ACCOUNT_URI!
-  const keyring = new Keyring({ type: 'sr25519' })
-  const sudo: KeyringPair = keyring.addFromUri(sudoUri)
-
-  const leadKeyPair: KeyringPair[] = Utils.createKeyPairs(keyring, 1)
+export default async function manageWorkerAsWorker(api: Api, env: NodeJS.ProcessEnv, group: WorkingGroups) {
   const applicationStake: BN = new BN(env.WORKING_GROUP_APPLICATION_STAKE!)
   const roleStake: BN = new BN(env.WORKING_GROUP_ROLE_STAKE!)
   const firstRewardInterval: BN = new BN(env.LONG_REWARD_INTERVAL!)
@@ -34,16 +21,20 @@ export default async function manageWorkerAsWorker(
   const payoutAmount: BN = new BN(env.PAYOUT_AMOUNT!)
   const unstakingPeriod: BN = new BN(env.STORAGE_WORKING_GROUP_UNSTAKING_PERIOD!)
   const openingActivationDelay: BN = new BN(0)
+  const paidTerms = api.createPaidTermId(new BN(+env.MEMBERSHIP_PAID_TERMS!))
+
+  const lead = await api.getGroupLead(group)
+  assert(lead)
+
+  const newMembers = api.createKeyPairs(1).map((key) => key.address)
 
-  assert(db.hasLeader(api.getWorkingGroupString(group)))
-  const nKeyPairs = db.getMembers()
-  leadKeyPair[0] = db.getLeader(api.getWorkingGroupString(group))
+  const memberSetFixture = new BuyMembershipHappyCaseFixture(api, newMembers, paidTerms)
+  // Recreating set of members
+  await memberSetFixture.runner(false)
+  const applicant = newMembers[0]
 
-  const addWorkerOpeningFixture: AddWorkerOpeningFixture = new AddWorkerOpeningFixture(
+  const addWorkerOpeningFixture = new AddWorkerOpeningFixture(
     api,
-    nKeyPairs,
-    leadKeyPair[0],
-    sudo,
     applicationStake,
     roleStake,
     openingActivationDelay,
@@ -53,72 +44,47 @@ export default async function manageWorkerAsWorker(
   // Add worker opening
   await addWorkerOpeningFixture.runner(false)
 
-  let applyForWorkerOpeningFixture: ApplyForOpeningFixture
   // First apply for worker opening
-  await (async () => {
-    applyForWorkerOpeningFixture = new ApplyForOpeningFixture(
-      api,
-      nKeyPairs,
-      sudo,
-      applicationStake,
-      roleStake,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await applyForWorkerOpeningFixture.runner(false)
-  })()
+  const applyForWorkerOpeningFixture = new ApplyForOpeningFixture(
+    api,
+    [applicant],
+    applicationStake,
+    roleStake,
+    addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
+    group
+  )
+  await applyForWorkerOpeningFixture.runner(false)
+  const applicationIdToHire = applyForWorkerOpeningFixture.getApplicationIds()[0]
 
-  let beginApplicationReviewFixture: BeginApplicationReviewFixture
   // Begin application review
-  await (async () => {
-    beginApplicationReviewFixture = new BeginApplicationReviewFixture(
-      api,
-      leadKeyPair[0],
-      sudo,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await beginApplicationReviewFixture.runner(false)
-  })()
+  const beginApplicationReviewFixture = new BeginApplicationReviewFixture(
+    api,
+    addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
+    group
+  )
+  await beginApplicationReviewFixture.runner(false)
 
-  let fillOpeningFixture: FillOpeningFixture
   // Fill worker opening
-  await (async () => {
-    fillOpeningFixture = new FillOpeningFixture(
-      api,
-      nKeyPairs,
-      leadKeyPair[0],
-      sudo,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      firstRewardInterval,
-      rewardInterval,
-      payoutAmount,
-      group
-    )
-    await fillOpeningFixture.runner(false)
-  })()
-
-  const increaseStakeFixture: IncreaseStakeFixture = new IncreaseStakeFixture(api, nKeyPairs, sudo, group)
-  // Increase worker stake
-  await increaseStakeFixture.runner(false)
-
-  const updateRewardAccountFixture: UpdateRewardAccountFixture = new UpdateRewardAccountFixture(
+  const fillOpeningFixture = new FillOpeningFixture(
     api,
-    nKeyPairs,
-    keyring,
-    sudo,
+    [applicationIdToHire],
+    addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
+    firstRewardInterval,
+    rewardInterval,
+    payoutAmount,
     group
   )
+  await fillOpeningFixture.runner(false)
+  const workerId = fillOpeningFixture.getWorkerIds()[0]
+  const increaseStakeFixture: IncreaseStakeFixture = new IncreaseStakeFixture(api, workerId, group)
+  // Increase worker stake
+  await increaseStakeFixture.runner(false)
+
+  const updateRewardAccountFixture: UpdateRewardAccountFixture = new UpdateRewardAccountFixture(api, workerId, group)
   // Update reward account
   await updateRewardAccountFixture.runner(false)
 
-  const updateRoleAccountFixture: UpdateRewardAccountFixture = new UpdateRewardAccountFixture(
-    api,
-    nKeyPairs,
-    keyring,
-    sudo,
-    group
-  )
+  const updateRoleAccountFixture: UpdateRewardAccountFixture = new UpdateRewardAccountFixture(api, workerId, group)
   // Update role account
   await updateRoleAccountFixture.runner(false)
 }

+ 0 - 121
tests/network-tests/src/flows/workingGroup/workerApplicationHappyCase.ts

@@ -1,121 +0,0 @@
-import { Api, WorkingGroups } from '../../Api'
-import { Keyring } from '@polkadot/api'
-import { KeyringPair } from '@polkadot/keyring/types'
-import BN from 'bn.js'
-import { Utils } from '../../utils'
-import {
-  AddWorkerOpeningFixture,
-  ApplyForOpeningFixture,
-  BeginApplicationReviewFixture,
-  FillOpeningFixture,
-  WithdrawApplicationFixture,
-} from '../../fixtures/workingGroupModule'
-import { OpeningId } from '@joystream/types/hiring'
-import { DbService } from '../../DbService'
-import { assert } from 'chai'
-
-// Worker application happy case scenario
-export default async function workerApplication(api: Api, env: NodeJS.ProcessEnv, db: DbService, group: WorkingGroups) {
-  const sudoUri: string = env.SUDO_ACCOUNT_URI!
-  const keyring = new Keyring({ type: 'sr25519' })
-  const sudo: KeyringPair = keyring.addFromUri(sudoUri)
-
-  const leadKeyPair: KeyringPair[] = Utils.createKeyPairs(keyring, 1)
-  const applicationStake: BN = new BN(env.WORKING_GROUP_APPLICATION_STAKE!)
-  const roleStake: BN = new BN(env.WORKING_GROUP_ROLE_STAKE!)
-  const firstRewardInterval: BN = new BN(env.LONG_REWARD_INTERVAL!)
-  const rewardInterval: BN = new BN(env.LONG_REWARD_INTERVAL!)
-  const payoutAmount: BN = new BN(env.PAYOUT_AMOUNT!)
-  const unstakingPeriod: BN = new BN(env.STORAGE_WORKING_GROUP_UNSTAKING_PERIOD!)
-  const openingActivationDelay: BN = new BN(0)
-
-  // const durationInBlocks = 48
-  // setTestTimeout(api, durationInBlocks)
-
-  assert(db.hasLeader(api.getWorkingGroupString(group)))
-  const nKeyPairs = db.getMembers()
-  leadKeyPair[0] = db.getLeader(api.getWorkingGroupString(group))
-
-  const addWorkerOpeningFixture: AddWorkerOpeningFixture = new AddWorkerOpeningFixture(
-    api,
-    nKeyPairs,
-    leadKeyPair[0],
-    sudo,
-    applicationStake,
-    roleStake,
-    openingActivationDelay,
-    unstakingPeriod,
-    group
-  )
-  // Add worker opening
-  await addWorkerOpeningFixture.runner(false)
-
-  let firstApplyForWorkerOpeningFixture: ApplyForOpeningFixture
-  // First apply for worker opening
-  await (async () => {
-    firstApplyForWorkerOpeningFixture = new ApplyForOpeningFixture(
-      api,
-      nKeyPairs,
-      sudo,
-      applicationStake,
-      roleStake,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await firstApplyForWorkerOpeningFixture.runner(false)
-  })()
-
-  const withdrawApplicationFixture: WithdrawApplicationFixture = new WithdrawApplicationFixture(
-    api,
-    nKeyPairs,
-    sudo,
-    group
-  )
-  // Withdraw worker application
-  await withdrawApplicationFixture.runner(false)
-
-  let secondApplyForWorkerOpeningFixture: ApplyForOpeningFixture
-  // Second apply for worker opening
-  await (async () => {
-    secondApplyForWorkerOpeningFixture = new ApplyForOpeningFixture(
-      api,
-      nKeyPairs,
-      sudo,
-      applicationStake,
-      roleStake,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await secondApplyForWorkerOpeningFixture.runner(false)
-  })()
-
-  let beginApplicationReviewFixture: BeginApplicationReviewFixture
-  // Begin application review
-  await (async () => {
-    beginApplicationReviewFixture = new BeginApplicationReviewFixture(
-      api,
-      leadKeyPair[0],
-      sudo,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await beginApplicationReviewFixture.runner(false)
-  })()
-
-  let fillOpeningFixture: FillOpeningFixture
-  // Fill worker opening
-  await (async () => {
-    fillOpeningFixture = new FillOpeningFixture(
-      api,
-      nKeyPairs,
-      leadKeyPair[0],
-      sudo,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      firstRewardInterval,
-      rewardInterval,
-      payoutAmount,
-      group
-    )
-    await fillOpeningFixture.runner(false)
-  })()
-}

+ 0 - 120
tests/network-tests/src/flows/workingGroup/workerApplicationRejectionCase.ts

@@ -1,120 +0,0 @@
-import { Api, WorkingGroups } from '../../Api'
-import { Keyring } from '@polkadot/api'
-import { KeyringPair } from '@polkadot/keyring/types'
-import BN from 'bn.js'
-import { Utils } from '../../utils'
-import {
-  AcceptApplicationsFixture,
-  AddWorkerOpeningFixture,
-  ApplyForOpeningFixture,
-  TerminateApplicationsFixture,
-} from '../../fixtures/workingGroupModule'
-import { OpeningId } from '@joystream/types/hiring'
-import { DbService } from '../../DbService'
-import { assert } from 'chai'
-
-// Worker application rejection case scenario
-export default async function workerApplicationRejection(
-  api: Api,
-  env: NodeJS.ProcessEnv,
-  db: DbService,
-  group: WorkingGroups
-) {
-  const sudoUri: string = env.SUDO_ACCOUNT_URI!
-  const keyring = new Keyring({ type: 'sr25519' })
-  const sudo: KeyringPair = keyring.addFromUri(sudoUri)
-
-  const leadKeyPair: KeyringPair[] = Utils.createKeyPairs(keyring, 1)
-  const nonMemberKeyPairs = Utils.createKeyPairs(keyring, 2)
-
-  const applicationStake: BN = new BN(env.WORKING_GROUP_APPLICATION_STAKE!)
-  const roleStake: BN = new BN(env.WORKING_GROUP_ROLE_STAKE!)
-  const unstakingPeriod: BN = new BN(env.STORAGE_WORKING_GROUP_UNSTAKING_PERIOD!)
-  const openingActivationDelay: BN = new BN(100)
-
-  assert(db.hasLeader(api.getWorkingGroupString(group)))
-  const nKeyPairs = db.getMembers()
-  leadKeyPair[0] = db.getLeader(api.getWorkingGroupString(group))
-
-  const addWorkerOpeningFixture: AddWorkerOpeningFixture = new AddWorkerOpeningFixture(
-    api,
-    nKeyPairs,
-    leadKeyPair[0],
-    sudo,
-    applicationStake,
-    roleStake,
-    openingActivationDelay,
-    unstakingPeriod,
-    group
-  )
-  // Add worker opening
-  await addWorkerOpeningFixture.runner(false)
-
-  let applyForWorkerOpeningBeforeAcceptanceFixture: ApplyForOpeningFixture
-  // Apply for worker opening, expect failure
-  await (async () => {
-    applyForWorkerOpeningBeforeAcceptanceFixture = new ApplyForOpeningFixture(
-      api,
-      nKeyPairs,
-      sudo,
-      applicationStake,
-      roleStake,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await applyForWorkerOpeningBeforeAcceptanceFixture.runner(true)
-  })()
-
-  let acceptApplicationsFixture: AcceptApplicationsFixture
-  // Begin accepting worker applications
-  await (async () => {
-    acceptApplicationsFixture = new AcceptApplicationsFixture(
-      api,
-      leadKeyPair[0],
-      sudo,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await acceptApplicationsFixture.runner(false)
-  })()
-
-  let applyForWorkerOpeningAsNonMemberFixture: ApplyForOpeningFixture
-  // Apply for worker opening as non-member, expect failure
-  await (async () => {
-    applyForWorkerOpeningAsNonMemberFixture = new ApplyForOpeningFixture(
-      api,
-      nonMemberKeyPairs,
-      sudo,
-      applicationStake,
-      roleStake,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await applyForWorkerOpeningAsNonMemberFixture.runner(true)
-  })()
-
-  let applyForWorkerOpeningFixture: ApplyForOpeningFixture
-  // Apply for worker opening
-  await (async () => {
-    applyForWorkerOpeningFixture = new ApplyForOpeningFixture(
-      api,
-      nKeyPairs,
-      sudo,
-      applicationStake,
-      roleStake,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await applyForWorkerOpeningFixture.runner(false)
-  })()
-
-  const terminateApplicationsFixture: TerminateApplicationsFixture = new TerminateApplicationsFixture(
-    api,
-    nKeyPairs,
-    leadKeyPair[0],
-    sudo,
-    group
-  )
-  // Terminate worker applicaitons
-  await terminateApplicationsFixture.runner(false)
-}

+ 39 - 87
tests/network-tests/src/flows/workingGroup/workerPayout.ts

@@ -1,34 +1,21 @@
 import { Api, WorkingGroups } from '../../Api'
-import { Keyring } from '@polkadot/api'
-import { KeyringPair } from '@polkadot/keyring/types'
 import {
   AddWorkerOpeningFixture,
   ApplyForOpeningFixture,
   AwaitPayoutFixture,
   BeginApplicationReviewFixture,
-  ExpectMintCapacityChangedFixture,
   FillOpeningFixture,
 } from '../../fixtures/workingGroupModule'
 import BN from 'bn.js'
-import { Utils } from '../../utils'
 import { VoteForProposalFixture, WorkingGroupMintCapacityProposalFixture } from '../../fixtures/proposalsModule'
 import { PaidTermId } from '@joystream/types/members'
 import { OpeningId } from '@joystream/types/hiring'
 import { ProposalId } from '@joystream/types/proposals'
-import { DbService } from '../../DbService'
 import { BuyMembershipHappyCaseFixture } from '../../fixtures/membershipModule'
 import { assert } from 'chai'
 
 // Worker payout scenario
-export default async function workerPayouts(api: Api, env: NodeJS.ProcessEnv, db: DbService, group: WorkingGroups) {
-  const sudoUri: string = env.SUDO_ACCOUNT_URI!
-  const keyring = new Keyring({ type: 'sr25519' })
-  const sudo: KeyringPair = keyring.addFromUri(sudoUri)
-
-  const N: number = +env.WORKING_GROUP_N!
-  const m1KeyPairs: KeyringPair[] = Utils.createKeyPairs(keyring, N)
-  const leadKeyPair: KeyringPair[] = Utils.createKeyPairs(keyring, 1)
-
+export default async function workerPayouts(api: Api, env: NodeJS.ProcessEnv, group: WorkingGroups) {
   const paidTerms: PaidTermId = api.createPaidTermId(new BN(+env.MEMBERSHIP_PAID_TERMS!))
   const applicationStake: BN = new BN(env.WORKING_GROUP_APPLICATION_STAKE!)
   const roleStake: BN = new BN(env.WORKING_GROUP_ROLE_STAKE!)
@@ -39,53 +26,31 @@ export default async function workerPayouts(api: Api, env: NodeJS.ProcessEnv, db
   const mintCapacity: BN = new BN(env.STORAGE_WORKING_GROUP_MINTING_CAPACITY!)
   const openingActivationDelay: BN = new BN(0)
 
-  assert(db.hasCouncil())
-  assert(db.hasLeader(api.getWorkingGroupString(group)))
+  const lead = await api.getGroupLead(group)
+  const newMembers = api.createKeyPairs(5).map((key) => key.address)
 
-  const m2KeyPairs = db.getCouncil()
-  const memberSetFixture: BuyMembershipHappyCaseFixture = new BuyMembershipHappyCaseFixture(
-    api,
-    sudo,
-    m1KeyPairs,
-    paidTerms
-  )
+  const memberSetFixture = new BuyMembershipHappyCaseFixture(api, newMembers, paidTerms)
   // Recreating set of members
   await memberSetFixture.runner(false)
 
-  leadKeyPair[0] = db.getLeader(api.getWorkingGroupString(group))
-
-  const workingGroupMintCapacityProposalFixture: WorkingGroupMintCapacityProposalFixture = new WorkingGroupMintCapacityProposalFixture(
+  const workingGroupMintCapacityProposalFixture = new WorkingGroupMintCapacityProposalFixture(
     api,
-    m1KeyPairs,
-    sudo,
+    newMembers[0],
     mintCapacity,
     group
   )
   // Propose mint capacity
   await workingGroupMintCapacityProposalFixture.runner(false)
 
-  let voteForProposalFixture: VoteForProposalFixture
-  const expectMintCapacityChanged: ExpectMintCapacityChangedFixture = new ExpectMintCapacityChangedFixture(
+  // Approve mint capacity
+  const voteForProposalFixture = new VoteForProposalFixture(
     api,
-    mintCapacity
+    workingGroupMintCapacityProposalFixture.getCreatedProposalId() as ProposalId
   )
-  // Approve mint capacity
-  await (async () => {
-    voteForProposalFixture = new VoteForProposalFixture(
-      api,
-      m2KeyPairs,
-      sudo,
-      workingGroupMintCapacityProposalFixture.getCreatedProposalId() as ProposalId
-    )
-    voteForProposalFixture.runner(false)
-    await expectMintCapacityChanged.runner(false)
-  })()
+  await voteForProposalFixture.runner(false)
 
-  const addWorkerOpeningFixture: AddWorkerOpeningFixture = new AddWorkerOpeningFixture(
+  const addWorkerOpeningFixture = new AddWorkerOpeningFixture(
     api,
-    m1KeyPairs,
-    leadKeyPair[0],
-    sudo,
     applicationStake,
     roleStake,
     openingActivationDelay,
@@ -95,52 +60,39 @@ export default async function workerPayouts(api: Api, env: NodeJS.ProcessEnv, db
   // Add worker opening
   await addWorkerOpeningFixture.runner(false)
 
-  let applyForWorkerOpeningFixture: ApplyForOpeningFixture
   // First apply for worker opening
-  await (async () => {
-    applyForWorkerOpeningFixture = new ApplyForOpeningFixture(
-      api,
-      m1KeyPairs,
-      sudo,
-      applicationStake,
-      roleStake,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await applyForWorkerOpeningFixture.runner(false)
-  })()
+  const applyForWorkerOpeningFixture = new ApplyForOpeningFixture(
+    api,
+    newMembers,
+    applicationStake,
+    roleStake,
+    addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
+    group
+  )
+  await applyForWorkerOpeningFixture.runner(false)
+  const applicationId = applyForWorkerOpeningFixture.getApplicationIds()[0]
 
-  let beginApplicationReviewFixture: BeginApplicationReviewFixture
   // Begin application review
-  await (async () => {
-    beginApplicationReviewFixture = new BeginApplicationReviewFixture(
-      api,
-      leadKeyPair[0],
-      sudo,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      group
-    )
-    await beginApplicationReviewFixture.runner(false)
-  })()
+  const beginApplicationReviewFixture = new BeginApplicationReviewFixture(
+    api,
+    addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
+    group
+  )
+  await beginApplicationReviewFixture.runner(false)
 
-  let fillOpeningFixture: FillOpeningFixture
   // Fill worker opening
-  await (async () => {
-    fillOpeningFixture = new FillOpeningFixture(
-      api,
-      m1KeyPairs,
-      leadKeyPair[0],
-      sudo,
-      addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
-      firstRewardInterval,
-      rewardInterval,
-      payoutAmount,
-      group
-    )
-    await fillOpeningFixture.runner(false)
-  })()
-
-  const awaitPayoutFixture: AwaitPayoutFixture = new AwaitPayoutFixture(api, m1KeyPairs, group)
+  const fillOpeningFixture = new FillOpeningFixture(
+    api,
+    [applicationId],
+    addWorkerOpeningFixture.getCreatedOpeningId() as OpeningId,
+    firstRewardInterval,
+    rewardInterval,
+    payoutAmount,
+    group
+  )
+  await fillOpeningFixture.runner(false)
+  const workerId = fillOpeningFixture.getWorkerIds()[0]
+  const awaitPayoutFixture: AwaitPayoutFixture = new AwaitPayoutFixture(api, workerId, group)
   // Await worker payout
   await awaitPayoutFixture.runner(false)
 }

+ 13 - 41
tests/network-tests/src/scenarios/full.ts

@@ -13,11 +13,9 @@ import textProposal from '../flows/proposals/textProposal'
 import validatorCountProposal from '../flows/proposals/validatorCountProposal'
 import workingGroupMintCapacityProposal from '../flows/proposals/workingGroupMintCapacityProposal'
 import atLeastValueBug from '../flows/workingGroup/atLeastValueBug'
-// import manageWorkerAsLead from '../flows/workingGroup/manageWorkerAsLead'
-// import manageWorkerAsWorker from '../flows/workingGroup/manageWorkerAsWorker'
-// import workerApplicaionHappyCase from '../flows/workingGroup/workerApplicationHappyCase'
-// import workerApplicationRejectionCase from '../flows/workingGroup/workerApplicationRejectionCase'
-// import workerPayout from '../flows/workingGroup/workerPayout'
+import manageWorkerAsLead from '../flows/workingGroup/manageWorkerAsLead'
+import manageWorkerAsWorker from '../flows/workingGroup/manageWorkerAsWorker'
+import workerPayout from '../flows/workingGroup/workerPayout'
 
 const scenario = async () => {
   const debug = Debugger('scenario:full')
@@ -28,20 +26,12 @@ const scenario = async () => {
 
   // Connect api to the chain
   const nodeUrl: string = env.NODE_URL || 'ws://127.0.0.1:9944'
-  const treasuryAccountUri = env.TREASURY_ACCOUNT_URI
   const provider = new WsProvider(nodeUrl)
-  const api: Api = await Api.create(provider, treasuryAccountUri || '//Alice', '//Alice')
+  const api: Api = await Api.create(provider, env.TREASURY_ACCOUNT_URI || '//Alice', '//Alice')
 
-  // Run flows serially passing them a 'context'
-
-  debug('Memberships')
-  await creatingMemberships(api, env)
-
-  debug('Council')
-  await councilSetup(api, env)
+  await Promise.all([creatingMemberships(api, env), councilSetup(api, env)])
 
   // MaxActiveProposalLimit = 5
-  debug('Basic Proposals')
   await Promise.all([
     electionParametersProposal(api, env),
     spendingProposal(api, env),
@@ -52,19 +42,10 @@ const scenario = async () => {
   await Promise.all([
     workingGroupMintCapacityProposal(api, env, WorkingGroups.StorageWorkingGroup),
     workingGroupMintCapacityProposal(api, env, WorkingGroups.ContentDirectoryWorkingGroup),
-  ])
-
-  // Test hiring and firing leads by the council throuh proposals
-  // Leads are fired at the end of the flows
-  debug('Lead Hiring through council proposals')
-  await Promise.all([
     manageLeaderRole(api, env, WorkingGroups.StorageWorkingGroup),
     manageLeaderRole(api, env, WorkingGroups.ContentDirectoryWorkingGroup),
   ])
 
-  /* workers tests */
-
-  debug('Sudo Hiring Leads')
   await Promise.all([
     leaderSetup(api, env, WorkingGroups.StorageWorkingGroup),
     leaderSetup(api, env, WorkingGroups.ContentDirectoryWorkingGroup),
@@ -73,23 +54,14 @@ const scenario = async () => {
   // Test bug only on one instance of working group is sufficient
   await atLeastValueBug(api, env)
 
-  // debug('Worker Tests')
-  // Promise.all([
-  //   async () => {
-  //     await manageWorkerAsLead(api, env, db, WorkingGroups.StorageWorkingGroup)
-  //     await manageWorkerAsWorker(api, env, db, WorkingGroups.StorageWorkingGroup)
-  //     await workerApplicaionHappyCase(api, env, db, WorkingGroups.StorageWorkingGroup)
-  //     await workerApplicationRejectionCase(api, env, db, WorkingGroups.StorageWorkingGroup)
-  //     await workerPayout(api, env, db, WorkingGroups.StorageWorkingGroup)
-  //   },
-  //   async () => {
-  //     await manageWorkerAsLead(api, env, db, WorkingGroups.ContentDirectoryWorkingGroup)
-  //     await manageWorkerAsWorker(api, env, db, WorkingGroups.ContentDirectoryWorkingGroup)
-  //     await workerApplicaionHappyCase(api, env, db, WorkingGroups.ContentDirectoryWorkingGroup)
-  //     await workerApplicationRejectionCase(api, env, db, WorkingGroups.ContentDirectoryWorkingGroup)
-  //     await workerPayout(api, env, db, WorkingGroups.ContentDirectoryWorkingGroup)
-  //   },
-  // ])
+  await Promise.all([
+    manageWorkerAsLead(api, env, WorkingGroups.StorageWorkingGroup),
+    manageWorkerAsWorker(api, env, WorkingGroups.StorageWorkingGroup),
+    workerPayout(api, env, WorkingGroups.StorageWorkingGroup),
+    manageWorkerAsLead(api, env, WorkingGroups.ContentDirectoryWorkingGroup),
+    manageWorkerAsWorker(api, env, WorkingGroups.ContentDirectoryWorkingGroup),
+    workerPayout(api, env, WorkingGroups.ContentDirectoryWorkingGroup),
+  ])
 
   // Note: disconnecting and then reconnecting to the chain in the same process
   // doesn't seem to work!

+ 1 - 24
yarn.lock

@@ -12608,7 +12608,7 @@ graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2
   resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
   integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==
 
-graceful-fs@^4.1.3, graceful-fs@^4.2.2, graceful-fs@^4.2.4:
+graceful-fs@^4.2.2, graceful-fs@^4.2.4:
   version "4.2.4"
   resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
   integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==
@@ -16607,11 +16607,6 @@ lodash.zip@^4.2.0:
   resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020"
   integrity sha1-7GZi5IlkCO1KtsVCo5kLcswIACA=
 
-lodash@4:
-  version "4.17.20"
-  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
-  integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
-
 lodash@^4.0.0, lodash@^4.0.1, lodash@^4.17.10, lodash@^4.17.19, lodash@^4.17.3, lodash@^4.17.5, lodash@^4.2.1, lodash@~4.17.10:
   version "4.17.19"
   resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
@@ -16700,17 +16695,6 @@ loud-rejection@^1.0.0:
     currently-unhandled "^0.4.1"
     signal-exit "^3.0.0"
 
-lowdb@^1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/lowdb/-/lowdb-1.0.0.tgz#5243be6b22786ccce30e50c9a33eac36b20c8064"
-  integrity sha512-2+x8esE/Wb9SQ1F9IHaYWfsC9FIecLOPrK4g17FGEayjUWH172H6nwicRovGvSE2CPZouc2MCIqCI7h9d+GftQ==
-  dependencies:
-    graceful-fs "^4.1.3"
-    is-promise "^2.1.0"
-    lodash "4"
-    pify "^3.0.0"
-    steno "^0.4.1"
-
 lower-case@^1.1.1:
   version "1.1.4"
   resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac"
@@ -23203,13 +23187,6 @@ stealthy-require@^1.1.1:
   resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
   integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=
 
-steno@^0.4.1:
-  version "0.4.4"
-  resolved "https://registry.yarnpkg.com/steno/-/steno-0.4.4.tgz#071105bdfc286e6615c0403c27e9d7b5dcb855cb"
-  integrity sha1-BxEFvfwobmYVwEA8J+nXtdy4Vcs=
-  dependencies:
-    graceful-fs "^4.1.3"
-
 store2@^2.7.1:
   version "2.11.2"
   resolved "https://registry.yarnpkg.com/store2/-/store2-2.11.2.tgz#a298e5e97b21b3ce7419b732540bc7c79cb007db"