mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 11:40:11 +03:00
api: remove deprecated Vats helpers
This commit is contained in:
parent
8400992c1d
commit
a514be3142
@ -1,10 +1,5 @@
|
||||
import { Poke, Scry } from '../lib';
|
||||
import { Vats, Vat, Pike } from './types';
|
||||
|
||||
export const getVats: Scry = {
|
||||
app: 'hood',
|
||||
path: '/kiln/vats'
|
||||
};
|
||||
import { Pike } from './types';
|
||||
|
||||
export const getPikes: Scry = {
|
||||
app: 'hood',
|
||||
@ -89,39 +84,6 @@ export function kilnResume(desk: string) {
|
||||
|
||||
export const scryLag: Scry = ({ app: 'hood', path: '/kiln/lag' });
|
||||
|
||||
export function getBlockers(vats: Vats): string[] {
|
||||
const blockers: string[] = [];
|
||||
const base = vats?.base;
|
||||
if(!base) {
|
||||
return blockers;
|
||||
}
|
||||
const blockedOn = base.arak.rail?.next?.[0]?.weft?.kelvin;
|
||||
if(!blockedOn) {
|
||||
return blockers;
|
||||
}
|
||||
|
||||
Object.entries(vats)
|
||||
.filter(([desk]) => desk !== 'base')
|
||||
.forEach(([desk, vat]) => {
|
||||
// assuming only %zuse
|
||||
const woofs = vat.arak.rail?.next || [];
|
||||
const kelvins = woofs.map(n => n.weft.kelvin);
|
||||
if(!(kelvins.includes(blockedOn))) {
|
||||
blockers.push(desk);
|
||||
}
|
||||
});
|
||||
|
||||
return blockers;
|
||||
}
|
||||
|
||||
export function getVatPublisher(vat: Vat): string | undefined {
|
||||
if (vat.arak.rail) {
|
||||
const { rail } = vat.arak;
|
||||
return (rail?.publisher || rail?.ship || undefined);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getPikePublisher(pike: Pike) {
|
||||
return pike.sync?.ship;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user