Skip to content

Commit

Permalink
fix: update to use postgres for test (#105)
Browse files Browse the repository at this point in the history
* fix: update to use postgres

* fix: flaky tests

* fix: review

* fix: lint
  • Loading branch information
mkobetic authored May 17, 2022
1 parent cb9603b commit 0ec6b34
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
10 changes: 9 additions & 1 deletion dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
services:
waku-node:
image: xmtp/node-go@sha256:489f72a4049272989b42032f6fe23aac91cfaf13c93605017d4dce93d21f4993
image: xmtp/node-go:latest
environment:
- GOWAKU-NODEKEY=8a30dcb604b0b53627a5adc054dbf434b446628d4bd1eccc681d223f0550ce67
command:
- --ws
- --store
- --message-db-connection-string=postgres://postgres:xmtp@db:5432/postgres?sslmode=disable
- --lightpush
- --ws-port=9001
- --wait-for-db=30s
ports:
- 9001:9001
depends_on:
- db
db:
image: postgres:13
environment:
POSTGRES_PASSWORD: xmtp
2 changes: 1 addition & 1 deletion src/store/PrivateTopicStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class NetworkStore implements Store {

async set(key: string, value: Buffer): Promise<void> {
const keys = Uint8Array.from(value)
await this.waku.relay.send(
await this.waku.lightPush.push(
await WakuMessage.fromBytes(keys, this.buildTopic(key))
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export async function publishUserContact(
keys: PublicKeyBundle,
address: string
): Promise<void> {
return waku.relay.send(
await waku.lightPush.push(
await WakuMessage.fromBytes(keys.toBytes(), buildUserContactTopic(address))
)
}
1 change: 1 addition & 0 deletions test/conversations/Conversations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('conversations', () => {
beforeEach(async () => {
alice = await Client.create(Wallet.createRandom(), opts)
bob = await Client.create(Wallet.createRandom(), opts)
await sleep(100)
})

afterEach(async () => {
Expand Down
1 change: 1 addition & 0 deletions test/store/NetworkStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe('PrivateTopicStore', () => {
expect(empty).toBeNull()

await store.set(key, Buffer.from(value))
await sleep(100)
const full = await store.get(key)

expect(full).toBeDefined()
Expand Down

0 comments on commit 0ec6b34

Please sign in to comment.