Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat, test: log classic routes to analytics #516

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/services/analytics-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class AnalyticsService implements AnalyticsServiceInterface {
tokenIn: order.input?.token,
tokenOut: order.outputs[0].token,
orderType: orderType,
route: JSON.stringify(order?.route),
}

if (isPriorityOrderEntity(order)) {
Expand Down
14 changes: 14 additions & 0 deletions test/unit/services/analytics-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ describe('Analytics Service', () => {
decayStartTime: 100,
decayEndTime: 200,
deadline: 300,
route: {
quote: "141645031452",
quote_gas_adjusted: "141645001774",
gas_price_wei: "28348591",
gas_use_estimate_quote: "29677",
gas_use_estimate: "186938",
method_parameters: {
calldata: "0x12341234123412341234",
value: "0x1234",
to: "0xdeadbeef"
}
},
input: {
token: '0xInputToken',
startAmount: '5000',
Expand Down Expand Up @@ -61,6 +73,7 @@ describe('Analytics Service', () => {
tokenOut: '0xOutputToken',
filler: '0xGetAddress',
orderType: 'Limit',
route: JSON.stringify(mockedOrder.route)
},
})
})
Expand Down Expand Up @@ -97,6 +110,7 @@ describe('Analytics Service', () => {
tokenOut: '0xOutputToken',
filler: '0xGetAddress',
orderType: 'Limit',
route: JSON.stringify(mockedOrder.route)
},
})
})
Expand Down
Loading