Skip to main content

neo3/neo_builder/transaction/
transaction_error.rs

1use crate::{
2	codec::CodecError, crypto::CryptoError, neo_builder::BuilderError, neo_clients::ProviderError,
3};
4use thiserror::Error;
5
6#[derive(Error, Debug, PartialEq, Clone)]
7#[non_exhaustive]
8pub enum TransactionError {
9	#[error("Script format error: {0}")]
10	ScriptFormat(String),
11	#[error("Signer configuration error: {0}")]
12	SignerConfiguration(String),
13	#[error("Invalid nonce")]
14	InvalidNonce,
15	#[error("Invalid block")]
16	InvalidBlock,
17	#[error("Invalid transaction")]
18	InvalidTransaction,
19	#[error("Invalid witness condition")]
20	InvalidWitnessCondition,
21	#[error("Too many signers")]
22	TooManySigners,
23	#[error("Duplicate signer")]
24	DuplicateSigner,
25	#[error("No signers")]
26	NoSigners,
27	#[error("No script")]
28	NoScript,
29	#[error("Empty script")]
30	EmptyScript,
31	#[error("Invalid sender")]
32	InvalidSender,
33	#[error("Invalid state: {0}")]
34	IllegalState(String),
35	#[error("Transaction too large")]
36	TxTooLarge,
37	#[error("Transaction configuration error: {0}")]
38	TransactionConfiguration(String),
39	#[error("Codec error: {0}")]
40	CodecError(#[from] CodecError),
41	#[error("Crypto error: {0}")]
42	CryptoError(#[from] CryptoError),
43	#[error(transparent)]
44	ProviderError(#[from] ProviderError),
45	#[error("Insufficient funds")]
46	InsufficientFunds,
47	#[error("Invalid script")]
48	InvalidScript,
49	#[error("Unknown transaction")]
50	UnknownTransaction,
51	#[error("Builder error: {0}")]
52	BuilderError(#[from] BuilderError),
53}