Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
wjthieme committed Jan 27, 2025
1 parent 0f21cbf commit 2d144d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ pub fn fetch_nonce(
rpc: &solana_client::rpc_client::RpcClient,
address: &Pubkey,
) -> Result<crate::shared::DecodedAccount<Nonce>, std::io::Error> {
let accounts = fetch_all_nonce(rpc, vec![*address])?;
let accounts = fetch_all_nonce(rpc, &[*address])?;
Ok(accounts[0].clone())
}

#[cfg(feature = "fetch")]
pub fn fetch_all_nonce(
rpc: &solana_client::rpc_client::RpcClient,
addresses: Vec<Pubkey>,
addresses: &[Pubkey],
) -> Result<Vec<crate::shared::DecodedAccount<Nonce>>, std::io::Error> {
let accounts = rpc
.get_multiple_accounts(&addresses)
Expand All @@ -89,14 +89,14 @@ pub fn fetch_maybe_nonce(
rpc: &solana_client::rpc_client::RpcClient,
address: &Pubkey,
) -> Result<crate::shared::MaybeAccount<Nonce>, std::io::Error> {
let accounts = fetch_all_maybe_nonce(rpc, vec![*address])?;
let accounts = fetch_all_maybe_nonce(rpc, &[*address])?;
Ok(accounts[0].clone())
}

#[cfg(feature = "fetch")]
pub fn fetch_all_maybe_nonce(
rpc: &solana_client::rpc_client::RpcClient,
addresses: Vec<Pubkey>,
addresses: &[Pubkey],
) -> Result<Vec<crate::shared::MaybeAccount<Nonce>>, std::io::Error> {
let accounts = rpc
.get_multiple_accounts(&addresses)
Expand Down
8 changes: 4 additions & 4 deletions packages/renderers-rust/public/templates/accountsPage.njk
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ pub fn fetch_{{ account.name | snakeCase }}(
rpc: &solana_client::rpc_client::RpcClient,
address: &Pubkey,
) -> Result<crate::shared::DecodedAccount<{{ account.name | pascalCase }}>, std::io::Error> {
let accounts = fetch_all_{{ account.name | snakeCase }}(rpc, vec![*address])?;
let accounts = fetch_all_{{ account.name | snakeCase }}(rpc, &[*address])?;
Ok(accounts[0].clone())
}

#[cfg(feature = "fetch")]
pub fn fetch_all_{{ account.name | snakeCase }}(
rpc: &solana_client::rpc_client::RpcClient,
addresses: Vec<Pubkey>,
addresses: &[Pubkey],
) -> Result<Vec<crate::shared::DecodedAccount<{{ account.name | pascalCase }}>>, std::io::Error> {
let accounts = rpc.get_multiple_accounts(&addresses)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;
Expand All @@ -160,14 +160,14 @@ pub fn fetch_maybe_{{ account.name | snakeCase }}(
rpc: &solana_client::rpc_client::RpcClient,
address: &Pubkey,
) -> Result<crate::shared::MaybeAccount<{{ account.name | pascalCase }}>, std::io::Error> {
let accounts = fetch_all_maybe_{{ account.name | snakeCase }}(rpc, vec![*address])?;
let accounts = fetch_all_maybe_{{ account.name | snakeCase }}(rpc, &[*address])?;
Ok(accounts[0].clone())
}

#[cfg(feature = "fetch")]
pub fn fetch_all_maybe_{{ account.name | snakeCase }}(
rpc: &solana_client::rpc_client::RpcClient,
addresses: Vec<Pubkey>,
addresses: &[Pubkey],
) -> Result<Vec<crate::shared::MaybeAccount<{{ account.name | pascalCase }}>>, std::io::Error> {
let accounts = rpc.get_multiple_accounts(&addresses)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;
Expand Down

0 comments on commit 2d144d9

Please sign in to comment.