Skip to content

Commit

Permalink
Remove unnecessary ethers specific itifs
Browse files Browse the repository at this point in the history
  • Loading branch information
yagopv committed May 8, 2024
1 parent d967c32 commit 4dba881
Showing 1 changed file with 36 additions and 42 deletions.
78 changes: 36 additions & 42 deletions packages/protocol-kit/tests/e2e/offChainSignatures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,51 +215,45 @@ describe('Off-chain signatures', () => {
}
)

itif(process.env.ETH_LIB === 'ethers')(
'should add the signature of the current signer using eth_signTypedData with ethers provider',
async () => {
const { safe, contractNetworks, provider } = await setupTests()
const safeAddress = await safe.getAddress()
const safeSdk = await Safe.create({
provider,
safeAddress,
contractNetworks
})
const safeTransactionData = {
to: safeAddress,
value: '0',
data: '0x'
}
const tx = await safeSdk.createTransaction({ transactions: [safeTransactionData] })
chai.expect(tx.signatures.size).to.be.eq(0)
const signedTx = await safeSdk.signTransaction(tx, SigningMethod.ETH_SIGN_TYPED_DATA)
chai.expect(tx.signatures.size).to.be.eq(0)
chai.expect(signedTx.signatures.size).to.be.eq(1)
it('should add the signature of the current signer using eth_signTypedData with ethers provider', async () => {
const { safe, contractNetworks, provider } = await setupTests()
const safeAddress = await safe.getAddress()
const safeSdk = await Safe.create({
provider,
safeAddress,
contractNetworks
})
const safeTransactionData = {
to: safeAddress,
value: '0',
data: '0x'
}
)
const tx = await safeSdk.createTransaction({ transactions: [safeTransactionData] })
chai.expect(tx.signatures.size).to.be.eq(0)
const signedTx = await safeSdk.signTransaction(tx, SigningMethod.ETH_SIGN_TYPED_DATA)
chai.expect(tx.signatures.size).to.be.eq(0)
chai.expect(signedTx.signatures.size).to.be.eq(1)
})

itif(process.env.ETH_LIB === 'ethers')(
'should add the signature of the current signer using eth_signTypedData_v3 with ethers provider',
async () => {
const { safe, contractNetworks, provider } = await setupTests()
const safeAddress = await safe.getAddress()
const safeSdk = await Safe.create({
provider,
safeAddress,
contractNetworks
})
const safeTransactionData = {
to: safeAddress,
value: '0',
data: '0x'
}
const tx = await safeSdk.createTransaction({ transactions: [safeTransactionData] })
chai.expect(tx.signatures.size).to.be.eq(0)
const signedTx = await safeSdk.signTransaction(tx, SigningMethod.ETH_SIGN_TYPED_DATA_V3)
chai.expect(tx.signatures.size).to.be.eq(0)
chai.expect(signedTx.signatures.size).to.be.eq(1)
it('should add the signature of the current signer using eth_signTypedData_v3 with ethers provider', async () => {
const { safe, contractNetworks, provider } = await setupTests()
const safeAddress = await safe.getAddress()
const safeSdk = await Safe.create({
provider,
safeAddress,
contractNetworks
})
const safeTransactionData = {
to: safeAddress,
value: '0',
data: '0x'
}
)
const tx = await safeSdk.createTransaction({ transactions: [safeTransactionData] })
chai.expect(tx.signatures.size).to.be.eq(0)
const signedTx = await safeSdk.signTransaction(tx, SigningMethod.ETH_SIGN_TYPED_DATA_V3)
chai.expect(tx.signatures.size).to.be.eq(0)
chai.expect(signedTx.signatures.size).to.be.eq(1)
})

it('should add the signature of the current signer using eth_signTypedData_v4', async () => {
const { safe, contractNetworks, provider } = await setupTests()
Expand Down

0 comments on commit 4dba881

Please sign in to comment.