Skip to content

Commit

Permalink
[#312] Minor test refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-ap committed Apr 25, 2024
1 parent d590929 commit 40fdefd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/passkey/test/SafeWebAuthnSignerProxyFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ describe('SafeWebAuthnSignerFactory', () => {

const factory = await ethers.getContractAt('SafeWebAuthnSignerFactory', SafeWebAuthnSignerFactory.address)

const singletonAddress = await factory.SINGLETON()
const MockContract = await ethers.getContractFactory('MockContract')
const mockVerifier = await MockContract.deploy()
const precompileAddress = `0x${'00'.repeat(18)}0100`
const mockPrecompile = await ethers.getContractAt('MockContract', precompileAddress)
await setCode(precompileAddress, await ethers.provider.getCode(mockVerifier))
const verifiers = BigInt(ethers.solidityPacked(['uint32', 'uint160'], [mockPrecompile.target, mockVerifier.target]))

return { factory, mockPrecompile, mockVerifier, verifiers, singletonAddress }
return { factory, mockPrecompile, mockVerifier, verifiers }
})

describe('getSigner', function () {
Expand Down Expand Up @@ -59,8 +58,9 @@ describe('SafeWebAuthnSignerFactory', () => {

describe('createSigner', function () {
it('Should create a signer and return its deterministic address', async () => {
const { factory, verifiers, singletonAddress } = await setupTests()
const { factory, verifiers } = await setupTests()

const singletonAddress = await factory.SINGLETON()
const x = ethers.id('publicKey.x')
const y = ethers.id('publicKey.y')

Expand Down

0 comments on commit 40fdefd

Please sign in to comment.