Skip to content

Commit c7c8c60

Browse files
authored
remove solana-decode-error (#104)
* remove DecodeError * fmt toml
1 parent 459e4fd commit c7c8c60

File tree

14 files changed

+5
-163
lines changed

14 files changed

+5
-163
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ members = [
1616
"commitment-config",
1717
"compute-budget-interface",
1818
"cpi",
19-
"decode-error",
2019
"define-syscall",
2120
"derivation-path",
2221
"ed25519-program",
@@ -221,7 +220,6 @@ solana-cluster-type = { path = "cluster-type", version = "2.2.1" }
221220
solana-commitment-config = { path = "commitment-config", version = "2.2.1" }
222221
solana-compute-budget-interface = { path = "compute-budget-interface", version = "2.2.1" }
223222
solana-cpi = { path = "cpi", version = "2.2.1" }
224-
solana-decode-error = { path = "decode-error", version = "2.2.1" }
225223
solana-define-syscall = { path = "define-syscall", version = "2.2.1" }
226224
solana-derivation-path = { path = "derivation-path", version = "2.2.1" }
227225
solana-ed25519-program = { path = "ed25519-program", version = "2.2.1" }
@@ -354,7 +352,6 @@ opt-level = 1
354352
solana-account = { path = "account" }
355353
solana-clock = { path = "clock" }
356354
solana-cpi = { path = "cpi" }
357-
solana-decode-error = { path = "decode-error" }
358355
solana-frozen-abi = { path = "frozen-abi" }
359356
solana-frozen-abi-macro = { path = "frozen-abi-macro" }
360357
solana-instruction = { path = "instruction" }

decode-error/Cargo.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

decode-error/src/lib.rs

Lines changed: 0 additions & 62 deletions
This file was deleted.

precompile-error/Cargo.toml

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

1515
[dependencies]
1616
num-traits = { workspace = true }
17-
solana-decode-error = { workspace = true }

precompile-error/src/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,3 @@ impl fmt::Display for PrecompileError {
6868
}
6969
}
7070
}
71-
72-
#[allow(deprecated)]
73-
impl<T> solana_decode_error::DecodeError<T> for PrecompileError {
74-
fn type_of() -> &'static str {
75-
"PrecompileError"
76-
}
77-
}

program-error/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ borsh = { workspace = true, optional = true }
2323
num-traits = { workspace = true }
2424
serde = { workspace = true, optional = true }
2525
serde_derive = { workspace = true, optional = true }
26-
solana-decode-error = { workspace = true }
2726
solana-instruction = { workspace = true, default-features = false, features = [
2827
"std",
2928
] }

program-error/src/lib.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,26 +129,18 @@ impl fmt::Display for ProgramError {
129129
pub trait PrintProgramError {
130130
fn print<E>(&self)
131131
where
132-
E: 'static
133-
+ std::error::Error
134-
+ solana_decode_error::DecodeError<E>
135-
+ PrintProgramError
136-
+ FromPrimitive;
132+
E: 'static + std::error::Error + PrintProgramError + FromPrimitive;
137133
}
138134

139135
#[allow(deprecated)]
140136
impl PrintProgramError for ProgramError {
141137
fn print<E>(&self)
142138
where
143-
E: 'static
144-
+ std::error::Error
145-
+ solana_decode_error::DecodeError<E>
146-
+ PrintProgramError
147-
+ FromPrimitive,
139+
E: 'static + std::error::Error + PrintProgramError + FromPrimitive,
148140
{
149141
match self {
150142
Self::Custom(error) => {
151-
if let Some(custom_error) = E::decode_custom_error_to_enum(*error) {
143+
if let Some(custom_error) = E::from_u32(*error) {
152144
custom_error.print::<E>();
153145
} else {
154146
msg!("Error: Unknown");

program/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ solana-blake3-hasher = { workspace = true, features = ["blake3"] }
6666
solana-borsh = { workspace = true, optional = true }
6767
solana-clock = { workspace = true, features = ["serde", "sysvar"] }
6868
solana-cpi = { workspace = true }
69-
solana-decode-error = { workspace = true }
7069
solana-epoch-rewards = { workspace = true, features = ["serde", "sysvar"] }
7170
solana-epoch-schedule = { workspace = true, features = ["serde", "sysvar"] }
7271
solana-fee-calculator = { workspace = true, features = ["serde"] }

pubkey/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ rand = { workspace = true, optional = true }
3939
serde = { workspace = true, optional = true }
4040
serde_derive = { workspace = true, optional = true }
4141
solana-atomic-u64 = { workspace = true }
42-
solana-decode-error = { workspace = true }
4342
solana-frozen-abi = { workspace = true, optional = true, features = [
4443
"frozen-abi",
4544
] }

0 commit comments

Comments
 (0)