Skip to content

Commit ecb5fd6

Browse files
committed
fix some tests
1 parent 8a83d43 commit ecb5fd6

File tree

7 files changed

+25
-38
lines changed

7 files changed

+25
-38
lines changed

tests/__snapshots__/delta.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ exports[`Delta:methods Get Delta Price 1`] = `
336336
"gasCostUSDBeforeFee": "dynamic_number",
337337
"hmac": "dynamic_string",
338338
"partner": "anon",
339-
"partnerFee": 0,
339+
"partnerFee": NaN,
340340
"receivedDestAmount": "dynamic_number",
341341
"receivedDestAmountBeforeFee": "dynamic_number",
342342
"receivedDestUSD": "dynamic_number",
@@ -378,7 +378,7 @@ exports[`Delta:methods Get Delta Price Crosschain Get Delta Price Crosschain/des
378378
"gasCostUSDBeforeFee": "dynamic_number",
379379
"hmac": "dynamic_string",
380380
"partner": "anon",
381-
"partnerFee": 0,
381+
"partnerFee": NaN,
382382
"receivedDestAmount": "dynamic_number",
383383
"receivedDestAmountBeforeFee": "dynamic_number",
384384
"receivedDestUSD": "dynamic_number",
@@ -420,7 +420,7 @@ exports[`Delta:methods Get Delta Price Crosschain Get Delta Price Crosschain/des
420420
"gasCostUSDBeforeFee": "dynamic_number",
421421
"hmac": "dynamic_string",
422422
"partner": "anon",
423-
"partnerFee": 0,
423+
"partnerFee": NaN,
424424
"receivedDestAmount": "dynamic_number",
425425
"receivedDestAmountBeforeFee": "dynamic_number",
426426
"receivedDestUSD": "dynamic_number",
@@ -462,7 +462,7 @@ exports[`Delta:methods Get Delta Price Crosschain Get Delta Price Crosschain/des
462462
"gasCostUSDBeforeFee": "dynamic_number",
463463
"hmac": "dynamic_string",
464464
"partner": "anon",
465-
"partnerFee": 0,
465+
"partnerFee": NaN,
466466
"receivedDestAmount": "dynamic_number",
467467
"receivedDestAmountBeforeFee": "dynamic_number",
468468
"receivedDestUSD": "dynamic_number",

tests/__snapshots__/partialSdk.test.ts.snap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
exports[`Partial SDK: fetching methods: axiosFetcher Get_Adapters: Get_Adapters 1`] = `
44
[
5-
"Bancor",
6-
"Compound",
75
"CurveV2",
86
"Lido",
97
"EtherFi",
108
"CurveV1",
11-
"Swerve",
129
"BalancerV1",
1310
"BalancerV2",
1411
"UniswapV2",
@@ -20,7 +17,6 @@ exports[`Partial SDK: fetching methods: axiosFetcher Get_Adapters: Get_Adapters
2017
"SushiSwapV3",
2118
"PancakeSwapV2",
2219
"PancakeswapV3",
23-
"AaveV2",
2420
"AaveV3",
2521
"AaveV3Lido",
2622
"Weth",
@@ -36,11 +32,9 @@ exports[`Partial SDK: fetching methods: axiosFetcher Get_Adapters: Get_Adapters
3632
"AngleStakedStableUSD",
3733
"AngleStakedStableEUR",
3834
"SolidlyV3",
39-
"Wombat",
4035
"Swell",
4136
"Spark",
4237
"sUSDS",
43-
"RingV2",
4438
"AugustusRFQ",
4539
]
4640
`;
@@ -118,13 +112,10 @@ exports[`Partial SDK: fetching methods: axiosFetcher Get_SwapTxData: Get_SwapTxD
118112

119113
exports[`Partial SDK: fetching methods: fetchFetcher Get_Adapters: Get_Adapters 1`] = `
120114
[
121-
"Bancor",
122-
"Compound",
123115
"CurveV2",
124116
"Lido",
125117
"EtherFi",
126118
"CurveV1",
127-
"Swerve",
128119
"BalancerV1",
129120
"BalancerV2",
130121
"UniswapV2",
@@ -136,7 +127,6 @@ exports[`Partial SDK: fetching methods: fetchFetcher Get_Adapters: Get_Adapters
136127
"SushiSwapV3",
137128
"PancakeSwapV2",
138129
"PancakeswapV3",
139-
"AaveV2",
140130
"AaveV3",
141131
"AaveV3Lido",
142132
"Weth",
@@ -152,11 +142,9 @@ exports[`Partial SDK: fetching methods: fetchFetcher Get_Adapters: Get_Adapters
152142
"AngleStakedStableUSD",
153143
"AngleStakedStableEUR",
154144
"SolidlyV3",
155-
"Wombat",
156145
"Swell",
157146
"Spark",
158147
"sUSDS",
159-
"RingV2",
160148
"AugustusRFQ",
161149
]
162150
`;

tests/__snapshots__/quote.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ exports[`Quote:methods Get Quote for market 1`] = `
7272
"maxImpactReached": false,
7373
"network": 1,
7474
"partner": "anon",
75-
"partnerFee": 0,
75+
"partnerFee": NaN,
7676
"side": "SELL",
7777
"srcAmount": "100000000000",
7878
"srcDecimals": 6,

tests/__snapshots__/simpleSdk.test.ts.snap

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22

33
exports[`Simple SDK: fetcher made with: axios Get_Adapters: Get_Adapters 1`] = `
44
[
5-
"Bancor",
6-
"Compound",
75
"CurveV2",
86
"Lido",
97
"EtherFi",
10-
"Stader",
118
"Bebop",
129
"CurveV1",
13-
"Swerve",
1410
"BalancerV1",
1511
"BalancerV2",
1612
"BalancerV3",
@@ -24,7 +20,6 @@ exports[`Simple SDK: fetcher made with: axios Get_Adapters: Get_Adapters 1`] = `
2420
"UniswapV4",
2521
"PancakeSwapV2",
2622
"PancakeswapV3",
27-
"AaveV2",
2823
"AaveV3",
2924
"AaveV3Lido",
3025
"Weth",
@@ -34,7 +29,6 @@ exports[`Simple SDK: fetcher made with: axios Get_Adapters: Get_Adapters 1`] = `
3429
"CurveV1Factory",
3530
"CurveV1StableNg",
3631
"wstETH",
37-
"wUSDM",
3832
"wUSDL",
3933
"sUSDe",
4034
"stcUSD",
@@ -47,14 +41,12 @@ exports[`Simple SDK: fetcher made with: axios Get_Adapters: Get_Adapters 1`] = `
4741
"AngleStakedStableUSD",
4842
"AngleStakedStableEUR",
4943
"SolidlyV3",
50-
"Wombat",
5144
"Swell",
5245
"Spark",
5346
"sUSDS",
5447
"AaveV3Stata",
5548
"AaveV3StataV2",
5649
"OSwap",
57-
"ConcentratorArusd",
5850
"FxProtocolRusd",
5951
"AaveGsm",
6052
"LitePsm",
@@ -143,15 +135,11 @@ exports[`Simple SDK: fetcher made with: axios Get_SwapTxData: Get_SwapTxData::tx
143135

144136
exports[`Simple SDK: fetcher made with: fetch Get_Adapters: Get_Adapters 1`] = `
145137
[
146-
"Bancor",
147-
"Compound",
148138
"CurveV2",
149139
"Lido",
150140
"EtherFi",
151-
"Stader",
152141
"Bebop",
153142
"CurveV1",
154-
"Swerve",
155143
"BalancerV1",
156144
"BalancerV2",
157145
"BalancerV3",
@@ -165,7 +153,6 @@ exports[`Simple SDK: fetcher made with: fetch Get_Adapters: Get_Adapters 1`] = `
165153
"UniswapV4",
166154
"PancakeSwapV2",
167155
"PancakeswapV3",
168-
"AaveV2",
169156
"AaveV3",
170157
"AaveV3Lido",
171158
"Weth",
@@ -175,7 +162,6 @@ exports[`Simple SDK: fetcher made with: fetch Get_Adapters: Get_Adapters 1`] = `
175162
"CurveV1Factory",
176163
"CurveV1StableNg",
177164
"wstETH",
178-
"wUSDM",
179165
"wUSDL",
180166
"sUSDe",
181167
"stcUSD",
@@ -188,14 +174,12 @@ exports[`Simple SDK: fetcher made with: fetch Get_Adapters: Get_Adapters 1`] = `
188174
"AngleStakedStableUSD",
189175
"AngleStakedStableEUR",
190176
"SolidlyV3",
191-
"Wombat",
192177
"Swell",
193178
"Spark",
194179
"sUSDS",
195180
"AaveV3Stata",
196181
"AaveV3StataV2",
197182
"OSwap",
198-
"ConcentratorArusd",
199183
"FxProtocolRusd",
200184
"AaveGsm",
201185
"LitePsm",

tests/delta.test.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,22 +171,27 @@ describe('Delta:methods', () => {
171171
const expectedToInclude = [
172172
{
173173
displayName: 'Across',
174+
icon: expect.any(String),
174175
protocol: 'Across',
175176
},
176177
{
177178
displayName: 'Stargate Bus',
179+
icon: expect.any(String),
178180
protocol: 'StargateBus',
179181
},
180182
{
181183
displayName: 'Stargate Taxi',
184+
icon: expect.any(String),
182185
protocol: 'StargateTaxi',
183186
},
184187
{
185188
displayName: 'Stargate OFT V2',
189+
icon: expect.any(String),
186190
protocol: 'StargateOftV2',
187191
},
188192
{
189193
displayName: 'Relay',
194+
icon: expect.any(String),
190195
protocol: 'Relay',
191196
},
192197
];
@@ -209,6 +214,7 @@ describe('Delta:methods', () => {
209214

210215
const staticDeltaPrice: typeof deltaPrice = {
211216
...deltaPrice,
217+
partnerFee: NaN, // dynamic number
212218
destAmount: 'dynamic_number',
213219
destAmountBeforeFee: 'dynamic_number',
214220
srcUSD: 'dynamic_number',
@@ -265,6 +271,7 @@ describe('Delta:methods', () => {
265271

266272
const staticDeltaPrice: typeof deltaPrice = {
267273
...deltaPrice,
274+
partnerFee: NaN, // dynamic number
268275
destToken: 'dynamic_address', // will no longer match DAI_TOKEN_ON_ETHEREUM if bridge is Relay
269276
bridge: {
270277
...deltaPrice.bridge,
@@ -322,6 +329,7 @@ describe('Delta:methods', () => {
322329

323330
const staticDeltaPrice: typeof deltaPrice = {
324331
...deltaPrice,
332+
partnerFee: NaN, // dynamic number
325333
bridge: {
326334
...deltaPrice.bridge,
327335
protocolData: 'dynamic_string',
@@ -376,6 +384,7 @@ describe('Delta:methods', () => {
376384

377385
const staticDeltaPrice: typeof deltaPrice = {
378386
...deltaPrice,
387+
partnerFee: NaN, // dynamic number
379388
bridge: {
380389
...deltaPrice.bridge,
381390
outputToken: 'dynamic_hash', // WETH or ETH depending on bridge used
@@ -538,6 +547,7 @@ describe('Delta:methods', () => {
538547
destToken: DAI,
539548
srcAmount: amount,
540549
destAmount: destAmountAfterSlippage, // minimum acceptable destAmount
550+
partnerAddress: ZERO_ADDRESS,
541551
});
542552

543553
const staticSignableOrderData: typeof signableOrderData = {
@@ -548,7 +558,7 @@ describe('Delta:methods', () => {
548558
nonce: 'dynamic_number',
549559
},
550560
};
551-
// capSurplus (true) shifted (<< 9) = 512
561+
// for ZERO partnerAddress capSurplus (true) shifted (<< 9) = 512
552562
expect(signableOrderData.data.partnerAndFee).toEqual((1 << 9).toString());
553563
expect(staticSignableOrderData).toMatchSnapshot();
554564
});
@@ -838,6 +848,7 @@ describe('Delta:methods', () => {
838848
destToken: DAI,
839849
srcAmount: amount,
840850
destAmount: destAmountAfterSlippage, // minimum acceptable destAmount
851+
partnerAddress: ZERO_ADDRESS,
841852
};
842853

843854
await dummySDK.submitDeltaOrder(input);
@@ -855,7 +866,7 @@ describe('Delta:methods', () => {
855866
nonce: 'dynamic_number',
856867
};
857868

858-
// capSurplus (true) shifted (<< 9) = 512
869+
// for ZERO partnerAddress capSurplus (true) shifted (<< 9) = 512
859870
expect(order.partnerAndFee).toEqual((1 << 9).toString());
860871
expect(staticSignedOrderData).toMatchSnapshot();
861872
});

tests/nftOrders.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,7 @@ describe('NFT Orders', () => {
12081208

12091209
const stablePriceRouteMatch: typeof priceRoute = {
12101210
...priceRoute,
1211+
partnerFee: NaN, // dynamic number, can change slightly depending on API config
12111212
blockNumber: NaN, // will change with time
12121213
srcAmount: '---', //will change based on srcToken/destToken rate
12131214
hmac: '---', // will change with any other change
@@ -1290,7 +1291,7 @@ describe('NFT Orders', () => {
12901291
"maxImpactReached": false,
12911292
"network": 1,
12921293
"partner": "anon",
1293-
"partnerFee": 0,
1294+
"partnerFee": NaN,
12941295
"side": "BUY",
12951296
"srcAmount": "---",
12961297
"srcDecimals": 18,

tests/quote.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ describe('Quote:methods', () => {
4848

4949
const staticDeltaPrice: typeof quote.delta = {
5050
...quote.delta,
51+
partnerFee: NaN, // dynamic number, can change slightly depending on API config
5152
hmac: 'dynamic_string',
5253
destAmount: 'dynamic_number',
5354
destAmountBeforeFee: 'dynamic_number',
@@ -84,7 +85,7 @@ describe('Quote:methods', () => {
8485
"gasCostUSDBeforeFee": "dynamic_number",
8586
"hmac": "dynamic_string",
8687
"partner": "anon",
87-
"partnerFee": 0,
88+
"partnerFee": NaN,
8889
"receivedDestAmount": "dynamic_number",
8990
"receivedDestAmountBeforeFee": "dynamic_number",
9091
"receivedDestUSD": "dynamic_number",
@@ -251,6 +252,7 @@ describe('Quote:methods', () => {
251252

252253
const priceRouteStable = {
253254
...priceRoute,
255+
partnerFee: NaN, // dynamic number, can change slightly depending on API config
254256
gasCost: 'dynamic_number',
255257
gasCostUSD: 'dynamic_number',
256258
hmac: 'dynamic_string',
@@ -281,6 +283,7 @@ describe('Quote:methods', () => {
281283

282284
const staticDeltaPrice: typeof quote.delta = {
283285
...quote.delta,
286+
partnerFee: NaN, // dynamic number, can change slightly depending on API config
284287
hmac: 'dynamic_string',
285288
destAmount: 'dynamic_number',
286289
destAmountBeforeFee: 'dynamic_number',
@@ -317,7 +320,7 @@ describe('Quote:methods', () => {
317320
"gasCostUSDBeforeFee": "dynamic_number",
318321
"hmac": "dynamic_string",
319322
"partner": "anon",
320-
"partnerFee": 0,
323+
"partnerFee": NaN,
321324
"receivedDestAmount": "dynamic_number",
322325
"receivedDestAmountBeforeFee": "dynamic_number",
323326
"receivedDestUSD": "dynamic_number",

0 commit comments

Comments
 (0)