Remove use of default network domain

This commit is contained in:
Pranav Gaddamadugu 2022-10-04 19:11:36 -07:00
parent 6ce64f8a78
commit 8872c3d53f
4 changed files with 4 additions and 18 deletions

View File

@ -83,18 +83,6 @@ impl Ast {
Self { ast: program }
}
/// Set the program name to the given string.
pub fn set_program_name(mut self, name: String) -> Self {
self.ast.name = name;
self
}
/// Set the network name to the given string.
pub fn set_network(mut self, network: String) -> Self {
self.ast.network = network;
self
}
/// Returns a reference to the inner program AST representation.
pub fn as_repr(&self) -> &Program {
&self.ast

View File

@ -95,9 +95,7 @@ impl<'a> Compiler<'a> {
let prg_sf = with_session_globals(|s| s.source_map.new_source(program_string, name));
// Use the parser to construct the abstract syntax tree (ast).
let mut ast: Ast = leo_parser::parse_ast(self.handler, &prg_sf.src, prg_sf.start_pos)?;
ast = ast.set_program_name(self.program_name.clone());
self.ast = ast.set_network(self.network.clone());
self.ast = leo_parser::parse_ast(self.handler, &prg_sf.src, prg_sf.start_pos)?;
if self.output_options.initial_ast {
self.write_ast_to_json("initial_ast.json")?;

View File

@ -240,7 +240,7 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result<Va
};
// Compile the program to bytecode.
let program_name = format!("{}.aleo", parsed.program_name);
let program_name = format!("{}.{}", parsed.program_name, parsed.network);
let bytecode = handler.extend_if_error(compile_and_process(&mut parsed, handler))?;
// Run snarkvm package.

View File

@ -74,8 +74,8 @@ struct Sample {
/// A helper function to help create a Leo Compiler struct.
fn new_compiler(handler: &Handler) -> Compiler<'_> {
Compiler::new(
String::new(),
String::new(),
String::from("bench"),
String::from("aleo"),
handler,
PathBuf::from(String::new()),
PathBuf::from(String::new()),