Skip to content

[Feature] make build_{eip} functions public #2516

Open
@mattsse

Description

@mattsse

Component

rpc

Describe the feature you would like

These are quite useful if you want to build a specific function

we can make all of these pub:

TxType::Legacy => self.build_legacy().expect("checked)").into(),
TxType::Eip2930 => self.build_2930().expect("checked)").into(),
TxType::Eip1559 => self.build_1559().expect("checked)").into(),
// `sidecar` is a hard requirement since this must be a _sendable_ transaction.
TxType::Eip4844 => self.build_4844_with_sidecar().expect("checked)").into(),
TxType::Eip7702 => self.build_7702().expect("checked)").into(),

and change the error from &str to ValueError<Self>,

fn build_7702(self) -> Result<TxEip7702, &'static str> {

this could be a bit disgusting, so we could maybe solve this with a macro or do something like:

let Some(tx_type) = self.buildable_type() else {
return Err(self);
};
Ok(match tx_type {

but ideally retain the actual error, because more useful

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions