Skip to content

Commit

Permalink
test(symbiosis): add additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmackz committed Oct 26, 2023
1 parent b054a10 commit d41d31b
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions packages/symbiosis/src/Symbiosis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { bridge } from './Symbiosis'
import {
PASSING_TEST_TRANSACTIONS,
FAILING_TEST_TRANSACTIONS,
controlTransaction,
} from './test-transactions'
import { metaBurnABI, metaRouteABI } from './abi'
import { ETH_CHAIN_ID, OPTIMISM_CHAIN_ID } from './constants'
Expand Down Expand Up @@ -69,8 +70,7 @@ describe('Given the symbiosis plugin', () => {
})
describe('should not pass filter with invalid parameters', () => {
test('when sourceChainId is incorrect', async () => {
const { transaction, tokenAddress, recipient } =
FAILING_TEST_TRANSACTIONS[0]
const { transaction, tokenAddress, recipient } = controlTransaction

const filter = await bridge({
sourceChainId: 1, // 42161
Expand All @@ -82,8 +82,7 @@ describe('Given the symbiosis plugin', () => {
expect(apply(transaction, filter)).to.be.false
})
test('when bridge contract address is incorrect', async () => {
const { transaction, tokenAddress, recipient } =
FAILING_TEST_TRANSACTIONS[0]
const { transaction, tokenAddress, recipient } = controlTransaction

const filter = await bridge({
sourceChainId: 42161,
Expand Down Expand Up @@ -116,4 +115,24 @@ describe('Given the symbiosis plugin', () => {
})
})
})
describe('control transaction should pass filter', () => {
test(controlTransaction.description, async () => {
const {
transaction,
destinationChainId,
tokenAddress,
amount,
recipient,
} = controlTransaction

const filter = await bridge({
sourceChainId: transaction.chainId,
destinationChainId,
tokenAddress,
amount: GreaterThanOrEqual(amount),
recipient,
})
expect(apply(transaction, filter)).to.be.true
})
})
})

0 comments on commit d41d31b

Please sign in to comment.