67 lines
1.6 KiB
Rust
Raw Normal View History

2020-10-30 20:29:05 +03:00
/*
* Copyright 2020 Fluence Labs Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#![allow(improper_ctypes)]
#![warn(rust_2018_idioms)]
#![deny(
dead_code,
nonstandard_style,
unused_imports,
unused_mut,
unused_variables,
unused_unsafe,
unreachable_patterns
)]
mod build_targets;
2021-01-15 00:38:58 +03:00
mod contexts;
2020-10-30 20:29:05 +03:00
mod execution;
2021-01-15 00:38:58 +03:00
mod preparation;
2020-10-30 20:29:05 +03:00
2021-01-15 00:38:58 +03:00
mod aqua;
pub mod log_targets;
2020-10-30 20:29:05 +03:00
2020-12-22 21:05:04 +03:00
pub use polyplets::ResolvedTriplet;
pub use polyplets::SecurityTetraplet;
pub use stepper_interface::StepperOutcome;
2021-01-15 00:38:58 +03:00
pub use stepper_interface::STEPPER_SUCCESS;
2020-12-22 21:05:04 +03:00
2021-01-15 00:38:58 +03:00
pub use aqua::execute_aqua;
2020-10-30 20:29:05 +03:00
2021-01-15 00:38:58 +03:00
pub mod execution_trace {
pub use crate::contexts::execution_trace::CallResult;
pub use crate::contexts::execution_trace::ExecutedState;
pub use crate::contexts::execution_trace::ExecutionTrace;
2020-12-22 21:05:04 +03:00
}
2021-01-15 00:38:58 +03:00
pub mod parser {
pub use air_parser::ast::Instruction;
2020-10-30 20:29:05 +03:00
2021-01-15 00:38:58 +03:00
/// Parse an AIR script to AST.
pub fn parse(script: &str) -> Result<Box<Instruction<'_>>, String> {
air_parser::parse(script)
2020-10-30 20:29:05 +03:00
}
}
2021-01-15 00:38:58 +03:00
pub(crate) type JValue = serde_json::Value;
2021-02-11 15:39:37 +03:00
#[macro_export]
macro_rules! exec_err {
($err:expr) => {
Err(std::rc::Rc::new($err))
};
}