1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use serde::Serialize;
use thiserror::Error;
#[derive(Debug, Error, Serialize)]
pub enum ValidateParserError {
#[error("Missing or empty assets directory")]
MissingOrEmptyAssetsDirectory,
#[error("Invalid assets directory")]
InvalidAssetsDirectory,
#[error("Name exceeds 32 chars.")]
NameTooLong,
#[error("Symbol exceeds 10 chars.")]
SymbolTooLong,
#[error("Url exceeds 200 chars.")]
UrlTooLong,
#[error("Creator address: '{0}' is invalid.")]
InvalidCreatorAddress(String),
#[error("Combined creators' share does not equal 100%.")]
InvalidCreatorShare,
#[error("Seller fee basis points value '{0}' is invalid: must be between 0 and 10,000.")]
InvalidSellerFeeBasisPoints(u16),
#[error("Missing animation url field")]
MissingAnimationUrl,
#[error("Missing external url field")]
MissingExternalUrl,
#[error("Missing collection field")]
MissingCollection,
#[error("Missing creators field")]
MissingCreators,
#[error("Missing seller fee basis points field")]
MissingSellerFeeBasisPoints,
#[error("Unexpected files found in assets directory")]
UnexpectedFilesFound,
#[error("No assets found in assets directory")]
NoAssetsFound,
#[error("Redundant file {0}.json")]
RedundantFile(usize),
#[error("File {0}.json is out of expected range")]
FileOutOfRange(usize),
#[error("Assets list isn't continuous please check files")]
NonContinuousSeries,
#[error("Invalid category '{0}': must be one of: {1}")]
InvalidCategory(String, String),
}