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
use thiserror::Error;
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum InterfaceGenError {
#[error("Cannot have two contracts with the same name {0}")]
DuplicateContracts(String),
#[error("No contracts to transpile")]
MissingContracts,
#[error("{0} is not a file")]
NotAFile(String),
#[error("Could not create interface for function {0} not in source")]
MissingFunction(String),
#[error("Expected license identifier")]
MissingLicense,
#[error("Cannot generate interface for {0}")]
GenerateInterfaceError(String),
#[error("Could not find targets for interface {0}")]
UnknownInterface(String),
#[error("Did not find expected contract {0} in sources")]
MissingContract(String),
}
pub type Result<T, E = InterfaceGenError> = core::result::Result<T, E>;