Skip to content

Commit

Permalink
change synchronizer to unirep app one
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisooo790926 committed Oct 2, 2023
1 parent 39355c2 commit d08a33d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/relay/test/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ describe('LOGIN /login', function () {
provider,
prover,
unirep,
app
app,
synchronizer
)
})

Expand Down
3 changes: 2 additions & 1 deletion packages/relay/test/post.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ describe('POST /post', function () {
provider,
prover,
unirep,
app
app,
synchronizer
)

// initUserStatus
Expand Down
7 changes: 6 additions & 1 deletion packages/relay/test/utils/UserStateFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,30 @@ import { UserState } from '@unirep/core'
import { Identity } from '@semaphore-protocol/identity'
import { ethers } from 'ethers'
import { Prover } from '@unirep/circuits'
import { UnirepSocialSynchronizer } from '../../src/synchornizer'

export class UserStateFactory {
db: DB
provider: ethers.providers.JsonRpcProvider
prover: Prover
unirepAddress: string
attesterId: string
synchronizer: UnirepSocialSynchronizer

constructor(
db: DB,
provider: ethers.providers.JsonRpcProvider,
prover: Prover,
unirepAddress: ethers.Contract,
attesterId: ethers.Contract
attesterId: ethers.Contract,
synchronizer: UnirepSocialSynchronizer
) {
this.db = db
this.provider = provider
this.prover = prover
this.unirepAddress = unirepAddress.address
this.attesterId = attesterId.address
this.synchronizer = synchronizer
}

async createUserState(user: User, wallet?: ethers.Wallet) {
Expand All @@ -33,6 +37,7 @@ export class UserStateFactory {
}
const identity = new Identity(signature)
return new UserState({
synchronizer: this.synchronizer,
db: this.db,
provider: this.provider,
prover: this.prover,
Expand Down

0 comments on commit d08a33d

Please sign in to comment.