From 2d559b357dbab382540a63d70704a9808eb7cc2a Mon Sep 17 00:00:00 2001 From: zizou <111426680+flopell@users.noreply.github.com> Date: Tue, 4 Mar 2025 12:06:15 +0100 Subject: [PATCH 1/2] fix(quickstart): map `ethereum` to `mainnet` when creating alloy `NamedChain`. The `NamedChain` enum doesn't use `ethereum` but `mainnet`. --- examples/quickstart/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/quickstart/main.rs b/examples/quickstart/main.rs index 14525ee3..952b1fde 100644 --- a/examples/quickstart/main.rs +++ b/examples/quickstart/main.rs @@ -161,7 +161,8 @@ async fn main() { ) .expect("Failed to private key signer"); let tx_signer = EthereumWallet::from(wallet.clone()); - let named_chain = NamedChain::from_str(&cli.chain).expect("Invalid chain"); + let named_chain = + NamedChain::from_str(&cli.chain.replace("ethereum", "mainnet")).expect("Invalid chain"); let provider = ProviderBuilder::new() .with_chain(named_chain) .wallet(tx_signer.clone()) From b8ad2d5dc400dfb72a9bda57c4e24027b4788d9c Mon Sep 17 00:00:00 2001 From: zizou <111426680+flopell@users.noreply.github.com> Date: Tue, 4 Mar 2025 15:09:01 +0100 Subject: [PATCH 2/2] feat(price_printer): display the protocol name for each row in the table --- examples/price_printer/ui.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/price_printer/ui.rs b/examples/price_printer/ui.rs index b1a6bb13..e232658d 100644 --- a/examples/price_printer/ui.rs +++ b/examples/price_printer/ui.rs @@ -69,8 +69,8 @@ struct Data { } impl Data { - const fn ref_array(&self) -> [&String; 3] { - [&self.name, &self.tokens, &self.price] + const fn ref_array(&self) -> [&String; 4] { + [&self.name, &self.component.protocol_system, &self.tokens, &self.price] } } @@ -284,7 +284,7 @@ impl App { .add_modifier(Modifier::REVERSED) .fg(self.colors.selected_cell_style_fg); - let header = ["Pool", "Tokens", "Price"] + let header = ["Pool", "Protocol", "Tokens", "Price"] .into_iter() .map(Cell::from) .collect::() @@ -318,6 +318,7 @@ impl App { Constraint::Length(43), Constraint::Min(1), Constraint::Min(1), + Constraint::Min(1), ], ) .header(header)