-
Notifications
You must be signed in to change notification settings - Fork 41
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
Forward parsed fullAppData #1448
Conversation
Pull Request Test Coverage Report for Build 8798247876Details
💛 - Coveralls |
'{}', | ||
'null', | ||
'{\n "version": "0.1.0",\n "appCode": "Yearn",\n "metadata": {\n "referrer": {\n "version": "0.1.0",\n "address": "0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52"\n }\n }\n}\n', | ||
])('is valid', (fullAppData) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the value is not used in the description text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5c1521c
it.each(['a', 'a : b', '{', '['])('is not valid', (fullAppData) => { | ||
const order = orderBuilder().with('fullAppData', fullAppData).build(); | ||
|
||
const result = OrderSchema.safeParse(order); | ||
|
||
expect(result.success).toBe(false); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not in the describe
block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5c1521c
}); | ||
}); | ||
|
||
it.each(['a', 'a : b', '{', '['])('is not valid', (fullAppData) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above regarding the value not in the description text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5c1521c
.nullish() | ||
.default(null), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As these are not before the transform
, null
and undefined
fullAppData
doesn't pass validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5c1521c
@@ -101,6 +101,8 @@ export class CowSwapConfirmationView implements Baseline, OrderInfo { | |||
}) | |||
executedSurplusFee: string | null; | |||
|
|||
fullAppData: Record<string, unknown> | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add an ApiPropertyOptional
(with description) for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5c1521c
@@ -90,6 +91,8 @@ export class SwapOrderTransactionInfo | |||
}) | |||
executedSurplusFee: string | null; | |||
|
|||
fullAppData: Record<string, unknown> | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As before regarding an ApiPropertyOptional
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 5c1521c
Summary
Adds the parsed App Data to the
OrderInfo
thus making it available inCowSwapConfirmationView
andSwapOrderTransactionInfo
.This can be specially useful to the clients if access to other order properties is required (e.g.
slippageBips
)Changes
fullAppData
.fullAppData
viaCowSwapConfirmationView
andSwapOrderTransactionInfo
.