Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion clients/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ serde = ["dep:serde", "dep:serde_with", "kaigan/serde"]

[dependencies]
borsh = "^0.10"
kaigan = "^0.2"
kaigan = "^0.3"
num-derive = "^0.4"
num-traits = "^0.2"
serde = { version = "^1.0", features = ["derive"], optional = true }
Expand All @@ -23,3 +23,9 @@ solana-client = { version = "2.3.4", optional = true }
solana-sdk = { version = "2.2.1", optional = true }
solana-program = "2.2.1"
thiserror = "^1.0"
solana-account = "~2.2"
solana-account-info = "~2.3"
solana-instruction = "~2.3"
solana-program-error = "~2.2"
solana-pubkey = { version = "~2.4", features = ["curve25519", "borsh"] }
solana-cpi = "~2.2"
16 changes: 7 additions & 9 deletions clients/rust/src/generated/accounts/nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::generated::types::NonceState;
use crate::generated::types::NonceVersion;
use borsh::BorshDeserialize;
use borsh::BorshSerialize;
use solana_program::pubkey::Pubkey;
use solana_pubkey::Pubkey;

#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down Expand Up @@ -39,12 +39,10 @@ impl Nonce {
}
}

impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for Nonce {
impl<'a> TryFrom<&solana_account_info::AccountInfo<'a>> for Nonce {
type Error = std::io::Error;

fn try_from(
account_info: &solana_program::account_info::AccountInfo<'a>,
) -> Result<Self, Self::Error> {
fn try_from(account_info: &solana_account_info::AccountInfo<'a>) -> Result<Self, Self::Error> {
let mut data: &[u8] = &(*account_info.data).borrow();
Self::deserialize(&mut data)
}
Expand All @@ -53,7 +51,7 @@ impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for Nonce {
#[cfg(feature = "fetch")]
pub fn fetch_nonce(
rpc: &solana_client::rpc_client::RpcClient,
address: &solana_program::pubkey::Pubkey,
address: &solana_pubkey::Pubkey,
) -> Result<crate::shared::DecodedAccount<Nonce>, std::io::Error> {
let accounts = fetch_all_nonce(rpc, &[*address])?;
Ok(accounts[0].clone())
Expand All @@ -62,7 +60,7 @@ pub fn fetch_nonce(
#[cfg(feature = "fetch")]
pub fn fetch_all_nonce(
rpc: &solana_client::rpc_client::RpcClient,
addresses: &[solana_program::pubkey::Pubkey],
addresses: &[solana_pubkey::Pubkey],
) -> Result<Vec<crate::shared::DecodedAccount<Nonce>>, std::io::Error> {
let accounts = rpc
.get_multiple_accounts(addresses)
Expand All @@ -87,7 +85,7 @@ pub fn fetch_all_nonce(
#[cfg(feature = "fetch")]
pub fn fetch_maybe_nonce(
rpc: &solana_client::rpc_client::RpcClient,
address: &solana_program::pubkey::Pubkey,
address: &solana_pubkey::Pubkey,
) -> Result<crate::shared::MaybeAccount<Nonce>, std::io::Error> {
let accounts = fetch_all_maybe_nonce(rpc, &[*address])?;
Ok(accounts[0].clone())
Expand All @@ -96,7 +94,7 @@ pub fn fetch_maybe_nonce(
#[cfg(feature = "fetch")]
pub fn fetch_all_maybe_nonce(
rpc: &solana_client::rpc_client::RpcClient,
addresses: &[solana_program::pubkey::Pubkey],
addresses: &[solana_pubkey::Pubkey],
) -> Result<Vec<crate::shared::MaybeAccount<Nonce>>, std::io::Error> {
let accounts = rpc
.get_multiple_accounts(addresses)
Expand Down
12 changes: 3 additions & 9 deletions clients/rust/src/generated/errors/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,8 @@ pub enum SystemError {
NonceUnexpectedBlockhashValue = 0x8,
}

impl solana_program::program_error::PrintProgramError for SystemError {
fn print<E>(&self) {
solana_program::msg!(&self.to_string());
}
}

impl<T> solana_program::decode_error::DecodeError<T> for SystemError {
fn type_of() -> &'static str {
"SystemError"
impl From<SystemError> for solana_program_error::ProgramError {
fn from(e: SystemError) -> Self {
solana_program_error::ProgramError::Custom(e as u32)
}
}
Loading