-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix: declarative actions on meta pn #1427
Conversation
WalkthroughThe updates across the various modules refine the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (3)
- packages/advanced-logic/src/extensions/payment-network/meta.ts (2 hunks)
- packages/advanced-logic/test/extensions/payment-network/meta.test.ts (1 hunks)
- packages/advanced-logic/test/utils/payment-network/meta-pn-data-generator.ts (5 hunks)
Additional comments not posted (8)
packages/advanced-logic/src/extensions/payment-network/meta.ts (2)
116-117
: Encapsulation of generic creation logic looks good.The introduction of
genericCreationAction
encapsulates the generic creation logic, improving code readability and maintainability.
Line range hint
119-132
:
Merging generic creation logic with specific values is correct.This ensures that the generic creation logic is combined with specific values, maintaining the correct state of the extension.
packages/advanced-logic/test/utils/payment-network/meta-pn-data-generator.ts (4)
18-20
: Declarations ofamount
,note
, andtxHash
are straightforward.These declarations are necessary for the
actionDeclareSentPayment
object.
77-86
: Introduction ofactionDeclareSentPayment
is correct.This object is necessary for testing the
declareSentPayment
functionality.
115-118
: Addition of payment and refund amount properties is necessary.These properties are necessary to track the payment and refund amounts.
163-166
: Addition of payment and refund amount properties is necessary.These properties are necessary to track the payment and refund amounts.
packages/advanced-logic/test/extensions/payment-network/meta.test.ts (2)
378-390
: New test case fordeclareSentPayment
is correct.This test case ensures that the
declareSentPayment
action works correctly.
392-402
: New test case fordeclareSentPayment
without a previous state is correct.This test case ensures that the
declareSentPayment
action is not allowed without a previous state.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (2)
- packages/payment-detection/src/meta-payment-detector.ts (1 hunks)
- packages/payment-detection/test/meta-payment-network.test.ts (1 hunks)
Additional comments not posted (2)
packages/payment-detection/src/meta-payment-detector.ts (1)
141-145
: LGTM! The type check enhances robustness.The added type check ensures that only valid objects are processed, preventing potential runtime errors.
packages/payment-detection/test/meta-payment-network.test.ts (1)
109-116
: LGTM! The added default values ensure comprehensive test coverage.Including default values for
payeeDelegate
,payerDelegate
,paymentInfo
,refundInfo
,receivedPaymentAmount
,receivedRefundAmount
,sentPaymentAmount
, andsentRefundAmount
ensures comprehensive test coverage and data consistency.
Description of the changes
Follow up on #1405
The default declarative values were missing when we were creating the meta-pn extension. It was not possible to perform declarative actions at the meta-pn level, such as
declareReceivedPayment
ordeclareSentPayment
Summary by CodeRabbit
New Features
Bug Fixes
Tests