Skip to content

Commit

Permalink
Use mev boost as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Jul 9, 2024
1 parent f0a381b commit 4a07615
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
35 changes: 18 additions & 17 deletions packages/admin-ui/src/pages/stakers/components/StakerNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,23 +221,24 @@ export default function StakerNetwork({
isSelected={Boolean(newWeb3signer)}
/>
</Col>
{["prater", "mainnet", "holesky"].includes(network) && (
<Col>
<SubTitle>Mev Boost</SubTitle>
<MevBoost
network={network}
mevBoost={currentStakerConfigReq.data.mevBoost}
newMevBoost={newMevBoost}
setNewMevBoost={setNewMevBoost}
newRelays={newRelays}
setNewRelays={setNewRelays}
isSelected={
currentStakerConfigReq.data.mevBoost.dnpName ===
newMevBoost?.dnpName
}
/>
</Col>
)}
{["prater", "mainnet", "holesky"].includes(network) &&
currentStakerConfigReq.data.mevBoost && (
<Col>
<SubTitle>Mev Boost</SubTitle>
<MevBoost
network={network}
mevBoost={currentStakerConfigReq.data.mevBoost}
newMevBoost={newMevBoost}
setNewMevBoost={setNewMevBoost}
newRelays={newRelays}
setNewRelays={setNewRelays}
isSelected={
currentStakerConfigReq.data.mevBoost.dnpName ===
newMevBoost?.dnpName
}
/>
</Col>
)}
</Row>
<hr />
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ export const useStakerConfig = <T extends Network>(
if (consensusClient && consensusClient.status === "ok")
setNewConsClient(consensusClient);

const currentMevBoost = isOkSelectedInstalledAndRunning(mevBoost)
? mevBoost
: null;
if (currentMevBoost && mevBoost.status === "ok") {
const currentMevBoost =
mevBoost && isOkSelectedInstalledAndRunning(mevBoost) ? mevBoost : null;
if (currentMevBoost && mevBoost?.status === "ok") {
setNewMevBoost(mevBoost);
mevBoost.relays && setNewRelays(mevBoost.relays);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/stakers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export interface StakerConfigGet {
executionClients: StakerItem[];
consensusClients: StakerItem[];
web3Signer: StakerItem;
mevBoost: StakerItem;
mevBoost?: StakerItem;
}

export interface StakerConfigSet {
Expand Down

0 comments on commit 4a07615

Please sign in to comment.