Skip to content

Commit

Permalink
wip: convert block template to payload and bid
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Bostoen authored and merklefruit committed Jun 17, 2024
1 parent 785a4b7 commit bc0e791
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion bolt-sidecar/src/template/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use alloy_primitives::{Address, U256};

use crate::{
common::max_transaction_cost,
primitives::{AccountState, TxInfo},
primitives::{AccountState, BuilderBid, PayloadAndBid, SignedBuilderBid, TxInfo},
};

/// A block template that serves as a fallback block, but is also used
Expand Down Expand Up @@ -136,3 +136,29 @@ impl StateDiff {
self.diffs.get(address).copied()
}
}

impl TryFrom<BlockTemplate> for PayloadAndBid {
type Error = Box<dyn std::error::Error>;

fn try_from(value: BlockTemplate) -> Result<Self, Self::Error> {
let bid = SignedBuilderBid {
message: BuilderBid {
header: todo!(),
blob_kzg_commitments: todo!(),
value: todo!(),
public_key: todo!(),
},
signature: todo!(),
};
}
}

pub struct Unsigned<T> {
message: T,
}

pub trait Signable {
type Signature;

fn sign(&self) -> Self::Signature;
}

0 comments on commit bc0e791

Please sign in to comment.