2020-09-21 14:11:09 +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.
|
|
|
|
*/
|
2020-09-30 12:39:00 +03:00
|
|
|
|
2020-10-16 12:47:46 +03:00
|
|
|
#![allow(improper_ctypes)]
|
2020-10-08 12:43:23 +03:00
|
|
|
#![warn(rust_2018_idioms)]
|
|
|
|
#![deny(
|
|
|
|
dead_code,
|
|
|
|
nonstandard_style,
|
|
|
|
unused_imports,
|
|
|
|
unused_mut,
|
|
|
|
unused_variables,
|
|
|
|
unused_unsafe,
|
|
|
|
unreachable_patterns
|
|
|
|
)]
|
|
|
|
|
2020-12-02 18:47:14 +03:00
|
|
|
mod ast;
|
2020-11-25 17:10:30 +03:00
|
|
|
mod logger;
|
|
|
|
|
2020-09-21 14:11:09 +03:00
|
|
|
use fluence::fce;
|
2021-02-17 23:36:36 +03:00
|
|
|
use interpreter_lib::execute_aqua;
|
|
|
|
use interpreter_lib::InterpreterOutcome;
|
2020-12-07 20:28:26 +03:00
|
|
|
|
2020-09-21 14:11:09 +03:00
|
|
|
pub fn main() {
|
2020-11-25 17:10:30 +03:00
|
|
|
logger::init_logger();
|
2020-10-08 14:27:59 +03:00
|
|
|
}
|
|
|
|
|
2020-09-28 15:40:27 +03:00
|
|
|
#[fce]
|
2021-02-17 23:36:36 +03:00
|
|
|
pub fn invoke(init_peer_id: String, aqua: String, prev_data: Vec<u8>, data: Vec<u8>) -> InterpreterOutcome {
|
2020-11-11 14:31:53 +03:00
|
|
|
execute_aqua(init_peer_id, aqua, prev_data, data)
|
2020-09-28 15:40:27 +03:00
|
|
|
}
|
2020-12-02 18:47:14 +03:00
|
|
|
|
|
|
|
#[fce]
|
|
|
|
pub fn ast(script: String) -> String {
|
|
|
|
ast::ast(script)
|
|
|
|
}
|