-
Notifications
You must be signed in to change notification settings - Fork 5
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: ✨ add batching to user charging #229
base: main
Are you sure you want to change the base?
Conversation
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.
Great job! Approved with one request for testing.
@@ -1270,6 +1270,136 @@ mod fixed_rate_streams { | |||
}); | |||
} | |||
|
|||
#[test] | |||
fn charge_multiple_users_payment_streams_works() { |
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.
I would like to see also a test cases for:
- Three users charged at once:
- Bob: one fixed rate payment stream.
- Charlie: one dynamic rate payment stream.
- Dave: one fixed and one dynamic rate payment stream.
- Three users charged at once, but (for whatever reason) the third user charged should fail. Here check that none of the users end up charged.
@@ -65,3 +65,6 @@ pub type UnitsProvidedFor<T> = <T as Config>::Units; | |||
/// Syntactic sugar for the ProviderId type used in the proofs pallet. | |||
pub type ProviderIdFor<T> = | |||
<<T as crate::Config>::ProvidersPallet as ReadProvidersInterface>::ProviderId; | |||
|
|||
/// Syntatic sugar for the maximum amount of Users a Provider can charge in a batch. |
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.
/// Syntatic sugar for the maximum amount of Users a Provider can charge in a batch. | |
/// Syntactic sugar for the maximum amount of Users a Provider can charge in a batch. |
This PR adds batching to BSPs charging users' payment streams and updates the BSP charge fees task to use the new functionality.