-
Notifications
You must be signed in to change notification settings - Fork 838
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Broker: sale price runtime api #3485
Conversation
@@ -595,6 +595,12 @@ impl_runtime_apis! { | |||
} | |||
} | |||
|
|||
impl pallet_broker_runtime_api::BrokerApi<Block, Balance> for Runtime { | |||
fn sale_price() -> Option<Balance> { |
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.
And do we maybe want to expose more stuff?
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.
It would be useful to fetch the unclaimed revenue of a region contributed to the instantaneous pool. I can add that as well.
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.
It would be useful to fetch the unclaimed revenue of a region contributed to the instantaneous pool.
After thinking about this a bit more not sure if adding this would make sense. Getting the unclaimed revenue can require quite a lot of reading(reading InstaPoolHistory
per each timeslice). So having this exposed could be an easy spam vector.
@Szegoo can you please add a prdoc Runtime Devs and Runtime Users |
@@ -455,4 +455,25 @@ impl<T: Config> Pallet<T> { | |||
|
|||
Ok(()) | |||
} | |||
|
|||
pub(crate) fn ensure_core_availability( |
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.
Can you please add some comment? I don't really get from reading the name what this does, because you don't really pass any core. Or maybe call it ensure_cores_for_sale
.
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 think ensure_cores_for_sale
is good.
Now if someone of the gentleman @joepetrowski @eskimor or @seadanda could approve this pr, we could merge it. |
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.
Some nits and a regression test would be nice, but already happy to merge
of a core in the ongoing sale. | ||
|
||
crates: | ||
- name: pallet-broker |
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.
Minor bumps? Not up to date on this, @bkchr is minor the default if a change is listed here or should it be explicit?
1c85bfe
Defines a runtime api for `pallet-broker` for getting the current price of a core if there is an ongoing sale. Closes: #3413 --------- Co-authored-by: Bastian Köcher <git@kchr.de>
Defines a runtime api for `pallet-broker` for getting the current price of a core if there is an ongoing sale. Closes: paritytech#3413 --------- Co-authored-by: Bastian Köcher <git@kchr.de>
Defines a runtime api for
pallet-broker
for getting the current price of a core if there is an ongoing sale.Closes: #3413