-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Coretime Broker on Coretime Chain - Update after Coretime Polkadot release #10947
Conversation
…from the workplan
if (parachainId) { | ||
return load?.filter(({ info }) => info.task === parachainId); | ||
return data.filter(({ workload }) => !!workload?.filter(({ info }) => info.task === parachainId).length); |
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.
Wouldn't !!workload
here just return a boolean?
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.
Yes, that is exactly what I am going for :) Coz I need to see if the is a workload with parachainId that I am looking for :) Then I can filter out objects of CoreInfo
export interface CoreInfo {
core: number,
workload: CoreWorkloadType[] | undefined,
workplan: CoreWorkplanType[] | undefined
}
|
||
useEffect(() => { | ||
setWorkLoad(formatLoad(workloadInfos, leaseMap, reservationMap)); | ||
}, [workloadInfos, leaseMap, reservationMap]); | ||
!!workplanInfos && !!workloadInfos && !!coreCount && !!leaseMap && !!reservationMap && |
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 dont think we need the double bangs on any of these values?
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.
Typescript begs to differ (for some of them) 😊 I might have thrown in some extras just in case 😅
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.
Overally super nice! Great job.
Just some nits, and I think generally we don't all the double bangs, but if you prefer them for readability (explicit booleans for checks) then I am okay with it.
I love my double bangs 😆 They leave no room for other interpretation 😊 |
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.
LGTM, approving so Im not a blocker while Im OOO. Great job
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Coretime has been released to the Polkadot Relay chain, but since the data was relying on the
Workload
pallet call, there is not data shown in theNetwork
->Coretime broker(Experimental)
Tab currently.In the initial sales period (sale 0), the Coretime chain isn't actively driving the relay chain; it's essentially in the same state as it was prior to the transition. During the bootstrapping phase, things operate a bit differently, but after the 28-day period, the workload will align with the current state of the relay chain moving forward.
This PR changes data organization, and takes the
coreCount
frombroker.status
call as the truth to how many cores are there, instead of relying onWorkload
to provide information about the cores.Other changes:
cores sold/offered
to the summary above the tableMy Coretime notes