Skip to content

Commit

Permalink
stress: use bot hashed private key as pickle key (#625)
Browse files Browse the repository at this point in the history
Closes #624
  • Loading branch information
miguel-nascimento authored Aug 6, 2024
1 parent 65f43c5 commit 369c352
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/stress/src/utils/stressClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { ChannelMessage_Post_Attachment, ChannelMessage_Post_Mention } from '@ri
import { waitFor } from './waitFor'
import { promises as fs } from 'node:fs'
import * as path from 'node:path'
import { sha256 } from 'ethers/lib/utils'
const logger = dlogger('stress:stressClient')

export async function makeStressClient(
Expand Down Expand Up @@ -203,10 +204,12 @@ export class StressClient {
if (rawDevice) {
device = JSON.parse(rawDevice) as ExportedDevice
}
const botPrivateKey = this.baseProvider.wallet.privateKey
await this.streamsClient.initializeUser({
spaceId: config.spaceId,
encryptionDeviceInit: {
fromExportedDevice: device,
pickleKey: sha256(botPrivateKey),
},
})
this.streamsClient.startSync()
Expand Down

0 comments on commit 369c352

Please sign in to comment.