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

Use PaymentId from common and simplify extrinsics API #338

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

olanod
Copy link
Member

@olanod olanod commented Feb 13, 2024

No description provided.

Copy link
Contributor

@hbulgarini hbulgarini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the new PaymentId approach, i left some minor comments.

pallets/payments/src/lib.rs Show resolved Hide resolved
pallets/payments/src/lib.rs Show resolved Hide resolved
pallets/payments/src/lib.rs Outdated Show resolved Hide resolved
pallets/payments/src/lib.rs Outdated Show resolved Hide resolved
pallets/payments/src/lib.rs Show resolved Hide resolved
use PaymentState::*;
let beneficiary = ensure_signed(origin)?;
let sender = T::Lookup::lookup(sender)?;
let (sender, b) = PaymentParties::<T>::get(&payment_id)?;
ensure!(beneficiary == b, Error::<T>::InvalidPayment);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the error would say something more descriptive as invalid beneficiary?

pallets/payments/src/lib.rs Show resolved Hide resolved
@olanod olanod force-pushed the updated-payment-id branch from fadf299 to b94ee4c Compare February 14, 2024 12:57
@olanod olanod merged commit 8cb01dc into master Feb 14, 2024
2 checks passed
@olanod olanod deleted the updated-payment-id branch February 14, 2024 22:12
@olanod
Copy link
Member Author

olanod commented Feb 14, 2024

Made some changes based on review, added the manual encoding/decoding of payment id as u64 and tested the happy path manually(rococo-local zombienet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants