Skip to content

Commit

Permalink
Merge pull request #29 from Brushfam/fix-file-build
Browse files Browse the repository at this point in the history
Canonicalize paths for a single file transpilation
  • Loading branch information
ivan770 committed Apr 27, 2023
2 parents aa46108 + 5df81c2 commit b217cf0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fn main() {
for file in files {
match file {
CliInput::SolidityFile(file) => {
let file_path = Path::new(&file);
let file_path = Path::new(&file).canonicalize().unwrap();
let file_home = file_path.parent().unwrap().to_str().unwrap();
match run(file_home, &[file.clone()]) {
Ok(_) => {
Expand Down
18 changes: 9 additions & 9 deletions src/structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub enum MemberType {
None(Box<Type>),
}

#[derive(Clone, Default,Debug)]
#[derive(Clone, Default, Debug)]
pub struct Contract {
pub name: String,
pub fields: Vec<ContractField>,
Expand All @@ -49,7 +49,7 @@ pub struct Contract {
pub base: Vec<String>,
}

#[derive(Clone, Default,Debug)]
#[derive(Clone, Default, Debug)]
pub struct Library {
pub name: String,
pub fields: Vec<ContractField>,
Expand All @@ -61,7 +61,7 @@ pub struct Library {
pub libraray_doc: Vec<String>,
}

#[derive(Clone, Default,Debug)]
#[derive(Clone, Default, Debug)]
pub struct Interface {
pub name: String,
pub events: Vec<Event>,
Expand All @@ -72,7 +72,7 @@ pub struct Interface {
pub comments: Vec<String>,
}

#[derive(Clone,Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ContractField {
pub field_type: Type,
pub name: String,
Expand All @@ -82,35 +82,35 @@ pub struct ContractField {
pub public: bool,
}

#[derive(Clone,Debug)]
#[derive(Clone, Debug)]
pub struct Event {
pub name: String,
pub fields: Vec<EventField>,
pub comments: Vec<String>,
}

#[derive(Clone,Debug)]
#[derive(Clone, Debug)]
pub struct EventField {
pub indexed: bool,
pub field_type: Type,
pub name: String,
pub comments: Vec<String>,
}

#[derive(Clone,Debug)]
#[derive(Clone, Debug)]
pub struct Enum {
pub name: String,
pub values: Vec<EnumValue>,
pub comments: Vec<String>,
}

#[derive(Default, Clone,Debug)]
#[derive(Default, Clone, Debug)]
pub struct EnumValue {
pub name: String,
pub comments: Vec<String>,
}

#[derive(Clone,Debug)]
#[derive(Clone, Debug)]
pub struct Struct {
pub name: String,
pub fields: Vec<StructField>,
Expand Down

0 comments on commit b217cf0

Please sign in to comment.