interface: move error module from program to interface#264
Conversation
joncinque
left a comment
There was a problem hiding this comment.
Looks good overall! Just a comment about removing thiserror usage. We could also eventually remove the num-traits and num-derive deps, but that would cause a breaking change, so we can save it for later. I don't think the trait impl is used at all, since removing it outright caused nothing to fail.
cc @grod220 for awareness too
| solana-instruction = { version = "3.3.0", features = ["std"] } | ||
| solana-program-error = "3.0" | ||
| solana-pubkey = { version = "4.1.0", features = ["curve25519"] } | ||
| thiserror = "2.0" |
There was a problem hiding this comment.
Rather than using thiserror, can we just implement core::error::Error and core::fmt::Display by hand on the type? We've done this in the past with things like https://github.com/anza-xyz/solana-sdk/blob/1eefc32264e1e3ff1081e150b7e4b6dadb03b466/address/src/error.rs#L12
| solana-pubkey = { version = "4.1.0", features = ["curve25519"] } | ||
| num-derive = "0.4" | ||
| num-traits = "0.2" | ||
| solana-instruction = "3.3.0" |
There was a problem hiding this comment.
std feature is unused in solana-instruction.
| num-traits = "0.2" | ||
| solana-instruction = "3.3.0" | ||
| solana-program-error = "3.0" | ||
| solana-pubkey = { version = "4.1.0", default-features = false, features = ["curve25519"] } |
There was a problem hiding this comment.
Default std feature is not needed.
error module from program to interfaceerror module from program to interface
|
Looks like clippy's complaining -- once that's resolved, we can land this 😄 |
Problem
For
p-atatheerrormodule resides in theinterface, but forspl-atait is in theprogram.Solution
Move the
errormodule from theprogramto theinterface.