Skip to content

Commit a6de629

Browse files
kevinheaveyjoncinque
authored andcommitted
program-error!: Make ProgramError compatible with pinocchio (anza-xyz#12)
* turn BorshIoError variants into unit variants make std optional in solana-program-error extract solana-pubkey-error crate add missing feature activation extract instruction-error crate remove unnecessary docs target from pubkey-error make num-traits optional in solana-program-error missing feature activation in solana-program move min_specialization to instruction-error missing feature activation in solana-instruction remove redundant DecodeError constraint from PrintProgramError remove unncecessary Error constraint from PrintProgramError remove num-traits dep and rename the num-traits feature to solana-msg add missing changes after removing num-traits make pubkey-error optional move instruction error codes to program-error and fix pubkey-error import fmt move PubkeyError back to solana-pubkey and move ProgramError conversion to solana-pubkey enable std if solana-msg is enabled add ToStr trait post-rebase fixes fmt toml * Fix CI, remove solana-instruction where not needed * Run cargo-sort --------- Co-authored-by: Jon C <[email protected]>
1 parent 78f1d35 commit a6de629

File tree

30 files changed

+218
-251
lines changed

30 files changed

+218
-251
lines changed

Cargo.lock

Lines changed: 21 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ members = [
3737
"hash",
3838
"inflation",
3939
"instruction",
40+
"instruction-error",
4041
"instructions-sysvar",
4142
"keccak-hasher",
4243
"keypair",
@@ -244,6 +245,7 @@ solana-hard-forks = { path = "hard-forks", version = "2.2.1", default-features =
244245
solana-hash = { path = "hash", version = "2.2.1", default-features = false }
245246
solana-inflation = { path = "inflation", version = "2.2.1" }
246247
solana-instruction = { path = "instruction", version = "2.3.0", default-features = false }
248+
solana-instruction-error = { path = "instruction-error", version = "1.0.0" }
247249
solana-instructions-sysvar = { path = "instructions-sysvar", version = "2.2.1" }
248250
solana-keccak-hasher = { path = "keccak-hasher", version = "2.2.1" }
249251
solana-keypair = { path = "keypair", version = "2.2.1" }

account/Cargo.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ all-features = true
1515
rustdoc-args = ["--cfg=docsrs"]
1616

1717
[features]
18-
bincode = [
19-
"dep:bincode",
20-
"dep:solana-sysvar",
21-
"solana-instruction/serde",
22-
"serde",
23-
]
18+
bincode = ["dep:bincode", "dep:solana-sysvar", "serde"]
2419
dev-context-only-utils = ["bincode", "dep:qualifier_attr"]
2520
frozen-abi = [
2621
"dep:solana-frozen-abi",
@@ -45,7 +40,7 @@ solana-account-info = { workspace = true }
4540
solana-clock = { workspace = true }
4641
solana-frozen-abi = { workspace = true, optional = true }
4742
solana-frozen-abi-macro = { workspace = true, optional = true }
48-
solana-instruction = { workspace = true }
43+
solana-instruction-error = { workspace = true }
4944
solana-logger = { workspace = true, optional = true }
5045
solana-pubkey = { workspace = true }
5146
solana-sdk-ids = { workspace = true }

account/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use solana_sysvar::Sysvar;
1313
use {
1414
solana_account_info::{debug_account_data::*, AccountInfo},
1515
solana_clock::{Epoch, INITIAL_RENT_EPOCH},
16-
solana_instruction::error::LamportsError,
16+
solana_instruction_error::LamportsError,
1717
solana_pubkey::Pubkey,
1818
solana_sdk_ids::{bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, loader_v4},
1919
std::{

account/src/state_traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use {
44
crate::{Account, AccountSharedData},
55
bincode::ErrorKind,
6-
solana_instruction::error::InstructionError,
6+
solana_instruction_error::InstructionError,
77
std::cell::Ref,
88
};
99

address-lookup-table-interface/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ rustdoc-args = ["--cfg=docsrs"]
1818
bincode = [
1919
"dep:bincode",
2020
"dep:solana-instruction",
21+
"dep:solana-instruction-error",
2122
"serde",
2223
"solana-instruction/bincode",
2324
]
@@ -39,6 +40,7 @@ solana-frozen-abi-macro = { workspace = true, features = [
3940
"frozen-abi",
4041
], optional = true }
4142
solana-instruction = { workspace = true, features = ["std"], optional = true }
43+
solana-instruction-error = { workspace = true, optional = true }
4244
solana-pubkey = { workspace = true }
4345
solana-sdk-ids = { workspace = true }
4446
solana-slot-hashes = { workspace = true }

address-lookup-table-interface/src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use serde_derive::{Deserialize, Serialize};
33
#[cfg(feature = "frozen-abi")]
44
use solana_frozen_abi_macro::{AbiEnumVisitor, AbiExample};
55
#[cfg(feature = "bincode")]
6-
use solana_instruction::error::InstructionError;
6+
use solana_instruction_error::InstructionError;
77
use {
88
crate::error::AddressLookupError,
99
solana_clock::Slot,

bincode/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
1515
[dependencies]
1616
bincode = { workspace = true }
1717
serde = { workspace = true }
18-
solana-instruction = { workspace = true, default-features = false, features = [
19-
"std",
20-
] }
18+
solana-instruction-error = { workspace = true }
2119

2220
[dev-dependencies]
2321
solana-system-interface = { workspace = true, features = ["bincode"] }

bincode/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! [bincode]: https://docs.rs/bincode
44
5-
use {bincode::config::Options, solana_instruction::error::InstructionError};
5+
use {bincode::config::Options, solana_instruction_error::InstructionError};
66

77
/// Deserialize with a limit based the maximum amount of data a program can expect to get.
88
/// This function should be used in place of direct deserialization to help prevent OOM errors

cpi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]
1414

1515
[dependencies]
1616
solana-account-info = { workspace = true }
17-
solana-instruction = { workspace = true }
17+
solana-instruction = { workspace = true, features = ["std"] }
1818
solana-program-error = { workspace = true }
1919
solana-pubkey = { workspace = true }
2020

0 commit comments

Comments
 (0)