Accelerator dashboard fix success criteria
This commit is contained in:
parent
5a55ba2d28
commit
f071d5e76a
@ -72,7 +72,7 @@ export class AccelerationFeesGraphComponent implements OnInit {
|
|||||||
this.hrStatsObservable$ = this.apiService.getAccelerationHistory$('24h').pipe(
|
this.hrStatsObservable$ = this.apiService.getAccelerationHistory$('24h').pipe(
|
||||||
map((accelerations) => {
|
map((accelerations) => {
|
||||||
return {
|
return {
|
||||||
avgFeeDelta: accelerations.filter(acc => acc.status === 'mined' || acc.status === 'completed').reduce((total, acc) => total + acc.feeDelta, 0) / accelerations.length
|
avgFeeDelta: accelerations.filter(acc => acc.status === 'completed').reduce((total, acc) => total + acc.feeDelta, 0) / accelerations.length
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@ -87,7 +87,7 @@ export class AccelerationFeesGraphComponent implements OnInit {
|
|||||||
}),
|
}),
|
||||||
map(([accelerations, blockFeesResponse]) => {
|
map(([accelerations, blockFeesResponse]) => {
|
||||||
return {
|
return {
|
||||||
avgFeeDelta: accelerations.filter(acc => acc.status === 'mined' || acc.status === 'completed').reduce((total, acc) => total + acc.feeDelta, 0) / accelerations.length
|
avgFeeDelta: accelerations.filter(acc => acc.status === 'completed').reduce((total, acc) => total + acc.feeDelta, 0) / accelerations.length
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@ -132,7 +132,7 @@ export class AccelerationFeesGraphComponent implements OnInit {
|
|||||||
const blockAccelerations = {};
|
const blockAccelerations = {};
|
||||||
|
|
||||||
for (const acceleration of accelerations) {
|
for (const acceleration of accelerations) {
|
||||||
if (acceleration.status === 'mined' || acceleration.status === 'completed') {
|
if (acceleration.status === 'completed') {
|
||||||
if (!blockAccelerations[acceleration.blockHeight]) {
|
if (!blockAccelerations[acceleration.blockHeight]) {
|
||||||
blockAccelerations[acceleration.blockHeight] = [];
|
blockAccelerations[acceleration.blockHeight] = [];
|
||||||
}
|
}
|
||||||
|
@ -54,12 +54,16 @@ export class AcceleratorDashboardComponent implements OnInit {
|
|||||||
)
|
)
|
||||||
]).pipe(
|
]).pipe(
|
||||||
switchMap(([blocks, accelerations]) => {
|
switchMap(([blocks, accelerations]) => {
|
||||||
|
const blockMap = {};
|
||||||
|
for (const block of blocks) {
|
||||||
|
blockMap[block.id] = block;
|
||||||
|
}
|
||||||
const accelerationsByBlock: { [ hash: string ]: Acceleration[] } = {};
|
const accelerationsByBlock: { [ hash: string ]: Acceleration[] } = {};
|
||||||
for (const acceleration of accelerations) {
|
for (const acceleration of accelerations) {
|
||||||
if (['mined', 'completed'].includes(acceleration.status) && !accelerationsByBlock[acceleration.blockHash]) {
|
if (['mined', 'completed'].includes(acceleration.status) && acceleration.pools.includes(blockMap[acceleration.blockHash]?.extras.pool.id)) {
|
||||||
accelerationsByBlock[acceleration.blockHash] = [];
|
if (!accelerationsByBlock[acceleration.blockHash]) {
|
||||||
}
|
accelerationsByBlock[acceleration.blockHash] = [];
|
||||||
if (['mined', 'completed'].includes(acceleration.status)) {
|
}
|
||||||
accelerationsByBlock[acceleration.blockHash].push(acceleration);
|
accelerationsByBlock[acceleration.blockHash].push(acceleration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user