Skip to content

Commit

Permalink
Merge pull request #160 from propeller-heads/zz/add-protocol-info-in-…
Browse files Browse the repository at this point in the history
…price-example

feat(price_printer): display the protocol name for each row in the table
  • Loading branch information
zizou0x authored Mar 4, 2025
2 parents 8448035 + b8ad2d5 commit 937fd33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions examples/price_printer/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}

Expand Down Expand Up @@ -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::<Row>()
Expand Down Expand Up @@ -318,6 +318,7 @@ impl App {
Constraint::Length(43),
Constraint::Min(1),
Constraint::Min(1),
Constraint::Min(1),
],
)
.header(header)
Expand Down
3 changes: 2 additions & 1 deletion examples/quickstart/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 937fd33

Please sign in to comment.