Skip to content

Commit b054a10

Browse files
committed
refactor(symbiosis): clean up and remove duplicate code
1 parent 3ab4f83 commit b054a10

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

packages/symbiosis/src/test-transactions.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const PASSING_TEST_TRANSACTIONS: TestTransaction[] = [
8484
},
8585
]
8686

87-
const failTransaction: Transaction = {
87+
const bridgeTx: Transaction = {
8888
chainId: 42161,
8989
from: '0xa99f898530df1514a566f1a6562d62809e99557d',
9090
input:
@@ -93,36 +93,33 @@ const failTransaction: Transaction = {
9393
value: '0',
9494
}
9595

96+
export const controlTransaction: TestTransaction = {
97+
transaction: bridgeTx,
98+
destinationChainId: 5000,
99+
amount: 10000000n,
100+
tokenAddress: '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8',
101+
recipient: '0xa99f898530df1514a566f1a6562d62809e99557d',
102+
description: 'when all parameters are correctly set',
103+
}
104+
96105
export const FAILING_TEST_TRANSACTIONS: TestTransaction[] = [
97106
{
98-
transaction: failTransaction,
107+
...controlTransaction,
99108
destinationChainId: 10, // 5000
100-
amount: 10000000n,
101-
tokenAddress: '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8',
102-
recipient: '0xa99f898530df1514a566f1a6562d62809e99557d',
103109
description: 'when destination chain is incorrect',
104110
},
105111
{
106-
transaction: failTransaction,
107-
destinationChainId: 5000,
112+
...controlTransaction,
108113
amount: 20000000n, // 10000000n
109-
tokenAddress: '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8',
110-
recipient: '0xa99f898530df1514a566f1a6562d62809e99557d',
111114
description: 'when amount is insufficient',
112115
},
113116
{
114-
transaction: failTransaction,
115-
destinationChainId: 5000,
116-
amount: 10000000n,
117+
...controlTransaction,
117118
tokenAddress: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831', // wrong USDC token
118-
recipient: '0xa99f898530df1514a566f1a6562d62809e99557d',
119119
description: 'when input token is incorrect',
120120
},
121121
{
122-
transaction: failTransaction,
123-
destinationChainId: 5000,
124-
amount: 10000000n,
125-
tokenAddress: '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8',
122+
...controlTransaction,
126123
recipient: '0xB7e98B3F16CC915B9C7a321c1bd95fa406BDbabe',
127124
description: 'when recipient is incorrect',
128125
},

0 commit comments

Comments
 (0)