From e990b7ca66df380513b1dab8f73993415dc2dea9 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Fri, 29 Sep 2023 10:46:36 -0400 Subject: [PATCH] Remove input errors --- errors/ERROR_INDEX.md | 2 -- errors/README.md | 8 ------- errors/src/errors/mod.rs | 10 +-------- errors/src/errors/state/mod.rs | 19 ---------------- errors/src/errors/state/state_errors.rs | 29 ------------------------- 5 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 errors/src/errors/state/mod.rs delete mode 100644 errors/src/errors/state/state_errors.rs diff --git a/errors/ERROR_INDEX.md b/errors/ERROR_INDEX.md index 039d20d286..01ec5214ab 100644 --- a/errors/ERROR_INDEX.md +++ b/errors/ERROR_INDEX.md @@ -2,8 +2,6 @@ ## Parser Errors: Error Code Range 370_000 - 370_999 -## State Errors: Error Code Range 371_000 - 371_999 - ## AST Errors: Error Code Range 372_000 - 372_999 ## ASG Errors: Error Code Range 373_000 - 373_999 diff --git a/errors/README.md b/errors/README.md index 392b6a83f1..90c0528a0c 100644 --- a/errors/README.md +++ b/errors/README.md @@ -49,10 +49,6 @@ The errors for the `leo-compiler` crate. Its error codes will range from 6_000-6 The errors for the `leo-imports` crate. Its error codes will range from 4_000-4_999 and be prefixed with the characters `IMP`. -### Input - -The errors for the `leo-ast` crate. Its error codes will range from 8_000-8_999 and be prefixed with the characters `INP`. - ### Loop Unrolling The errors for loop unrolling in the `leo-passes` crate. Its error codes will range from 9_000-9_999 and be prefixed with the characters `LUN`. @@ -70,10 +66,6 @@ The errors for the `leo-parser` crate. Its error codes will range from 0-999 and The errors from SnarkVM that bubble up into Leo in some situations. For right now, they have an exit code of 1. When SnarkVM implements better error codes and messages, we can bubble them up. -### State - -The errors for the `leo-state` crate. Its error codes will range from 1_000-1_999 and be prefixed with the characters `STA`. - ### Utils The errors related to dependency retrieval in the `utils` crate. Its error codes will range from 10_000-10_999 and be prefixed with the characters `DEP`. diff --git a/errors/src/errors/mod.rs b/errors/src/errors/mod.rs index a747a1bef6..80b84cd314 100644 --- a/errors/src/errors/mod.rs +++ b/errors/src/errors/mod.rs @@ -33,10 +33,7 @@ pub use self::compiler::*; pub mod flattener; pub use self::flattener::*; -/// Contains the Input error definitions. -pub mod input; -pub use self::input::*; - +/// Contains the Loop Unroller error definitions. pub mod loop_unroller; pub use self::loop_unroller::*; @@ -69,9 +66,6 @@ pub enum LeoError { /// Represents an Compiler Error in a Leo Error. #[error(transparent)] CompilerError(#[from] CompilerError), - /// Represents an Input Error in a Leo Error. - #[error(transparent)] - InputError(#[from] InputError), /// Represents an Package Error in a Leo Error. #[error(transparent)] PackageError(#[from] PackageError), @@ -108,7 +102,6 @@ impl LeoError { AstError(error) => error.error_code(), CompilerError(error) => error.error_code(), CliError(error) => error.error_code(), - InputError(error) => error.error_code(), ParserError(error) => error.error_code(), PackageError(error) => error.error_code(), TypeCheckerError(error) => error.error_code(), @@ -128,7 +121,6 @@ impl LeoError { AstError(error) => error.exit_code(), CompilerError(error) => error.exit_code(), CliError(error) => error.exit_code(), - InputError(error) => error.exit_code(), ParserError(error) => error.exit_code(), PackageError(error) => error.exit_code(), TypeCheckerError(error) => error.exit_code(), diff --git a/errors/src/errors/state/mod.rs b/errors/src/errors/state/mod.rs deleted file mode 100644 index d67880f7c0..0000000000 --- a/errors/src/errors/state/mod.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -/// This module contains the State error definitions. -pub mod state_errors; -pub use self::state_errors::*; diff --git a/errors/src/errors/state/state_errors.rs b/errors/src/errors/state/state_errors.rs deleted file mode 100644 index fe29e529e5..0000000000 --- a/errors/src/errors/state/state_errors.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -use crate::create_errors; - -use std::{ - error::Error as ErrorArg, - fmt::{Debug, Display}, -}; - -create_errors!( - /// StateError enum that represents all the errors for the `leo-state` crate. - StateError, - exit_code_mask: 1000i32, - error_code_prefix: "STA", -);