Skip to content

Commit

Permalink
Remove validation of fullFeeAmount (#2258)
Browse files Browse the repository at this point in the history
`fullFeeAmount` is no longer being returned by CoW, but we are validating it. This removes validation of the field and its presence from the codebase.

Note: `solverFee` has also been removed from mock data as that is also not used (though not validated):

- Remove validation of `fullFeeAmount`
- Remove mock `solveFee` values
- Propagate across codebase
  • Loading branch information
iamacook authored Jan 14, 2025
1 parent f9259e5 commit 163c1ec
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 43 deletions.
1 change: 0 additions & 1 deletion src/domain/swaps/entities/__tests__/order.builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export function orderBuilder(): IBuilder<Order> {
.with('executedFeeAmount', faker.number.bigInt({ min: 1 }))
.with('invalidated', faker.datatype.boolean())
.with('status', faker.helpers.arrayElement(Object.values(OrderStatus)))
.with('fullFeeAmount', faker.number.bigInt({ min: 1 }))
.with('isLiquidityOrder', faker.datatype.boolean())
.with(
'ethflowData',
Expand Down
1 change: 0 additions & 1 deletion src/domain/swaps/entities/order.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export const OrderSchema = z.object({
executedFeeAmount: z.coerce.bigint(),
invalidated: z.boolean(),
status: z.nativeEnum(OrderStatus).catch(OrderStatus.Unknown),
fullFeeAmount: z.coerce.bigint(),
isLiquidityOrder: z.boolean(),
ethflowData: z
.object({
Expand Down
2 changes: 0 additions & 2 deletions src/domain/swaps/swaps.repository.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const orderIds = {
from: null,
fullAppData:
'{"version":"0.4.0","appCode":"DefiLlama","environment":"production","metadata":{"referrer":{"version":"0.1.0","address":"0x08a3c2A819E3de7ACa384c798269B3Ce1CD0e437"}}}',
fullFeeAmount: BigInt('0'),
invalidated: false,
isLiquidityOrder: false,
kind: 'sell',
Expand Down Expand Up @@ -78,7 +77,6 @@ const orderIds = {
from: null,
fullAppData:
'{"appCode":"CoW Swap","environment":"production","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":"200"}},"version":"0.11.0"}',
fullFeeAmount: BigInt('0'),
invalidated: false,
isLiquidityOrder: false,
kind: 'sell',
Expand Down
1 change: 0 additions & 1 deletion src/routes/transactions/helpers/swap-order.helper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ describe('Swap Order Helper tests', () => {
feeAmount: order.feeAmount,
from: order.from,
fullAppData: order.fullAppData,
fullFeeAmount: order.fullFeeAmount,
invalidated: order.invalidated,
isLiquidityOrder: order.isLiquidityOrder,
kind: order.kind,
Expand Down
30 changes: 0 additions & 30 deletions src/routes/transactions/mappers/common/twap-order.mapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -257,8 +255,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -396,8 +392,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -629,8 +623,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData: JSON.parse(
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -729,8 +721,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData: JSON.parse(
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -935,8 +925,6 @@ describe('TwapOrderMapper', () => {
status: 'open',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -1054,8 +1042,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -1173,8 +1159,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -1213,8 +1197,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -1335,8 +1317,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -1375,8 +1355,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -1416,8 +1394,6 @@ describe('TwapOrderMapper', () => {
status: 'open',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -1535,8 +1511,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -1575,8 +1549,6 @@ describe('TwapOrderMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -1615,8 +1587,6 @@ describe('TwapOrderMapper', () => {
status: 'expired',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"Safe Wallet Swaps","metadata":{"orderClass":{"orderClass":"twap"},"partnerFee":{"bps":35,"recipient":"0x63695Eee2c3141BDE314C5a6f89B98E62808d716"},"quote":{"slippageBips":1000},"widget":{"appCode":"CoW Swap-SafeApp","environment":"production"}},"version":"1.1.0"}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ describe('SwapTransferInfoMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"CoW Swap","environment":"production","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50},"utm":{"utmContent":"header-cta-button","utmMedium":"web","utmSource":"cow.fi"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -299,8 +297,6 @@ describe('SwapTransferInfoMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"CoW Swap","environment":"production","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50},"utm":{"utmContent":"header-cta-button","utmMedium":"web","utmSource":"cow.fi"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -422,8 +418,6 @@ describe('SwapTransferInfoMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"CoW Swap","environment":"production","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50},"utm":{"utmContent":"header-cta-button","utmMedium":"web","utmSource":"cow.fi"}},"version":"1.1.0"}',
Expand Down Expand Up @@ -459,8 +453,6 @@ describe('SwapTransferInfoMapper', () => {
status: 'fulfilled',
class: 'limit',
settlementContract: '0x9008d19f58aabd9ed0d60971565aa8510560ab41',
fullFeeAmount: '0',
solverFee: '0',
isLiquidityOrder: false,
fullAppData:
'{"appCode":"CoW Swap","environment":"production","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50},"utm":{"utmContent":"header-cta-button","utmMedium":"web","utmSource":"cow.fi"}},"version":"1.1.0"}',
Expand Down

0 comments on commit 163c1ec

Please sign in to comment.