From f9371771e679f9cd1bb8a087cc4bb243321d47c1 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:04:59 -0700 Subject: [PATCH] fix --- .circleci/token/run.sh | 4 ++++ examples/auction/.env | 2 +- examples/auction/run.sh | 2 ++ examples/basic_bank/.env | 1 + examples/basic_bank/run.sh | 2 ++ examples/battleship/run.sh | 4 ++++ examples/bubblesort/.env | 1 + examples/core/.env | 1 + examples/fibonacci/.env | 1 + examples/groups/.env | 1 + examples/hackers-delight/ntzdebruijn/.env | 1 + examples/hackers-delight/ntzgaudet/.env | 1 + examples/hackers-delight/ntzloops/.env | 1 + examples/hackers-delight/ntzmasks/.env | 1 + examples/hackers-delight/ntzreisers/.env | 1 + examples/hackers-delight/ntzseals/.env | 1 + examples/hackers-delight/ntzsearchtree/.env | 1 + examples/hackers-delight/ntzsmallvals/.env | 1 + examples/helloworld/.env | 1 + examples/interest/.env | 1 + examples/lottery/.env | 1 + examples/message/.env | 1 + examples/simple_token/.env | 1 + examples/tictactoe/.env | 1 + examples/token/.env | 1 + examples/token/run.sh | 4 ++++ examples/twoadicity/.env | 1 + examples/vote/.env | 1 + leo/cli/commands/execute.rs | 6 ++---- leo/cli/helpers/context.rs | 2 +- 30 files changed, 42 insertions(+), 6 deletions(-) diff --git a/.circleci/token/run.sh b/.circleci/token/run.sh index e52735ed54..431fdff172 100644 --- a/.circleci/token/run.sh +++ b/.circleci/token/run.sh @@ -21,6 +21,7 @@ fi echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env # Publicly mint 100 tokens for Alice. @@ -89,6 +90,7 @@ leo run mint_private aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshd echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env # Publicly transfer 10 tokens from Alice to Bob. @@ -161,6 +163,7 @@ leo run transfer_private "{ echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env # Convert 30 public tokens from Alice into 30 private tokens for Bob. @@ -237,4 +240,5 @@ leo run transfer_private_to_public "{ echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env diff --git a/examples/auction/.env b/examples/auction/.env index 391701926c..22a5c2dd00 100644 --- a/examples/auction/.env +++ b/examples/auction/.env @@ -1,4 +1,4 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH - +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/auction/run.sh b/examples/auction/run.sh index d13f3de839..40f668611e 100755 --- a/examples/auction/run.sh +++ b/examples/auction/run.sh @@ -40,6 +40,7 @@ echo " echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env # Have the first bidder place a bid of 10. @@ -141,6 +142,7 @@ leo run finish "{ echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env diff --git a/examples/basic_bank/.env b/examples/basic_bank/.env index 391701926c..f79f0a688b 100644 --- a/examples/basic_bank/.env +++ b/examples/basic_bank/.env @@ -1,4 +1,5 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/basic_bank/run.sh b/examples/basic_bank/run.sh index 9ac451db87..a96e475aa4 100755 --- a/examples/basic_bank/run.sh +++ b/examples/basic_bank/run.sh @@ -20,6 +20,7 @@ fi echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env # Have the bank issue 100 tokens to the user. @@ -164,6 +165,7 @@ echo " echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env # Have the bank withdraw all of the user's tokens with compound interest over 15 periods at 12.34%. diff --git a/examples/battleship/run.sh b/examples/battleship/run.sh index e6e86718aa..af718af6b6 100755 --- a/examples/battleship/run.sh +++ b/examples/battleship/run.sh @@ -19,6 +19,7 @@ echo " echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env echo "✅ Successfully initialized Player 1." @@ -117,6 +118,7 @@ echo " echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env leo run play '{ @@ -187,6 +189,7 @@ echo " echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env leo run play '{ @@ -250,4 +253,5 @@ echo " echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env diff --git a/examples/bubblesort/.env b/examples/bubblesort/.env index c7836c7232..abae561342 100644 --- a/examples/bubblesort/.env +++ b/examples/bubblesort/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/core/.env b/examples/core/.env index c7836c7232..abae561342 100644 --- a/examples/core/.env +++ b/examples/core/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/fibonacci/.env b/examples/fibonacci/.env index c7836c7232..abae561342 100644 --- a/examples/fibonacci/.env +++ b/examples/fibonacci/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/groups/.env b/examples/groups/.env index c7836c7232..abae561342 100644 --- a/examples/groups/.env +++ b/examples/groups/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/hackers-delight/ntzdebruijn/.env b/examples/hackers-delight/ntzdebruijn/.env index c7836c7232..abae561342 100644 --- a/examples/hackers-delight/ntzdebruijn/.env +++ b/examples/hackers-delight/ntzdebruijn/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/hackers-delight/ntzgaudet/.env b/examples/hackers-delight/ntzgaudet/.env index c7836c7232..abae561342 100644 --- a/examples/hackers-delight/ntzgaudet/.env +++ b/examples/hackers-delight/ntzgaudet/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/hackers-delight/ntzloops/.env b/examples/hackers-delight/ntzloops/.env index c7836c7232..abae561342 100644 --- a/examples/hackers-delight/ntzloops/.env +++ b/examples/hackers-delight/ntzloops/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/hackers-delight/ntzmasks/.env b/examples/hackers-delight/ntzmasks/.env index c7836c7232..abae561342 100644 --- a/examples/hackers-delight/ntzmasks/.env +++ b/examples/hackers-delight/ntzmasks/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/hackers-delight/ntzreisers/.env b/examples/hackers-delight/ntzreisers/.env index c7836c7232..abae561342 100644 --- a/examples/hackers-delight/ntzreisers/.env +++ b/examples/hackers-delight/ntzreisers/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/hackers-delight/ntzseals/.env b/examples/hackers-delight/ntzseals/.env index c7836c7232..abae561342 100644 --- a/examples/hackers-delight/ntzseals/.env +++ b/examples/hackers-delight/ntzseals/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/hackers-delight/ntzsearchtree/.env b/examples/hackers-delight/ntzsearchtree/.env index c7836c7232..abae561342 100644 --- a/examples/hackers-delight/ntzsearchtree/.env +++ b/examples/hackers-delight/ntzsearchtree/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/hackers-delight/ntzsmallvals/.env b/examples/hackers-delight/ntzsmallvals/.env index c7836c7232..abae561342 100644 --- a/examples/hackers-delight/ntzsmallvals/.env +++ b/examples/hackers-delight/ntzsmallvals/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/helloworld/.env b/examples/helloworld/.env index c7836c7232..abae561342 100644 --- a/examples/helloworld/.env +++ b/examples/helloworld/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/interest/.env b/examples/interest/.env index c7836c7232..abae561342 100644 --- a/examples/interest/.env +++ b/examples/interest/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/lottery/.env b/examples/lottery/.env index c7836c7232..abae561342 100644 --- a/examples/lottery/.env +++ b/examples/lottery/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/message/.env b/examples/message/.env index c7836c7232..abae561342 100644 --- a/examples/message/.env +++ b/examples/message/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/simple_token/.env b/examples/simple_token/.env index c7836c7232..abae561342 100644 --- a/examples/simple_token/.env +++ b/examples/simple_token/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/tictactoe/.env b/examples/tictactoe/.env index c7836c7232..abae561342 100644 --- a/examples/tictactoe/.env +++ b/examples/tictactoe/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/token/.env b/examples/token/.env index 391701926c..f79f0a688b 100644 --- a/examples/token/.env +++ b/examples/token/.env @@ -1,4 +1,5 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/token/run.sh b/examples/token/run.sh index 1b212bf0fa..11f5951d14 100755 --- a/examples/token/run.sh +++ b/examples/token/run.sh @@ -20,6 +20,7 @@ fi echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env # Publicly mint 100 tokens for Alice. @@ -88,6 +89,7 @@ leo run mint_private aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env # Publicly transfer 10 tokens from Alice to Bob. @@ -160,6 +162,7 @@ leo run transfer_private "{ echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env # Convert 30 public tokens from Alice into 30 private tokens for Bob. @@ -236,4 +239,5 @@ leo run transfer_private_to_public "{ echo " NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 " > .env diff --git a/examples/twoadicity/.env b/examples/twoadicity/.env index c7836c7232..abae561342 100644 --- a/examples/twoadicity/.env +++ b/examples/twoadicity/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/examples/vote/.env b/examples/vote/.env index c7836c7232..abae561342 100644 --- a/examples/vote/.env +++ b/examples/vote/.env @@ -1,2 +1,3 @@ NETWORK=mainnet PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH +ENDPOINT=https://api.explorer.aleo.org/v1 diff --git a/leo/cli/commands/execute.rs b/leo/cli/commands/execute.rs index 50dcfac2ae..35a1ac57bd 100644 --- a/leo/cli/commands/execute.rs +++ b/leo/cli/commands/execute.rs @@ -172,8 +172,7 @@ fn handle_execute( // Load the main program, and all of its imports. let program_id = &ProgramID::::from_str(&format!("{}.aleo", program_name))?; - // TODO: X - load_program_from_network(&command, context.clone(), &mut vm.process().write(), program_id, network, endpoint)?; + load_program_from_network(context.clone(), &mut vm.process().write(), program_id, network, endpoint)?; let fee_record = if let Some(record) = command.fee_options.record { Some(parse_record(&private_key, &record)?) @@ -322,7 +321,6 @@ fn handle_execute( /// A helper function to recursively load the program and all of its imports into the process. Lifted from snarkOS. fn load_program_from_network( - command: &Execute, context: Context, process: &mut Process, program_id: &ProgramID, @@ -354,7 +352,7 @@ fn load_program_from_network( // Add the imports to the process if does not exist yet. if !process.contains_program(import_program_id) { // Recursively load the program and its imports. - load_program_from_network(command, context.clone(), process, import_program_id, network, endpoint)?; + load_program_from_network(context.clone(), process, import_program_id, network, endpoint)?; } } diff --git a/leo/cli/helpers/context.rs b/leo/cli/helpers/context.rs index 9d7eb5a230..2d367a8038 100644 --- a/leo/cli/helpers/context.rs +++ b/leo/cli/helpers/context.rs @@ -23,7 +23,7 @@ use snarkvm::file::Manifest; use aleo_std::aleo_dir; use indexmap::IndexMap; -use snarkvm::prelude::{Itertools, Network, PrivateKey}; +use snarkvm::prelude::{Network, PrivateKey}; use std::{ env::current_dir, fs::File,