leo icon indicating copy to clipboard operation
leo copied to clipboard

[Bug] Panic during deployment

Open KVolodin opened this issue 8 months ago • 0 comments

🐛 Bug Report

If you create an application using leo new from the mainnet branch, a .env file will be created which will contain some kind of private key and the name of the network, if you then rebuild leo from the testnet-beta branch and perform a leo deploy , the private key from the mainnet will break the program, with panic

Steps to Reproduce

Code snippet to reproduce

git clone https://github.com/AleoHQ/leo
cd leo
git checkout mainnet
cargo install --path .

mkdir /tmp/examples && cd /tmp/examples
leo new helloword

cd -
git checkout testnet-beta
cargo install --path .

cd -
leo deploy

Stack trace & error message

stack backtrace:
   0: leo::set_panic_hook::{{closure}}
   1: std::panicking::rust_panic_with_hook
   2: std::panicking::begin_panic_handler::{{closure}}
   3: std::sys_common::backtrace::__rust_end_short_backtrace
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::result::unwrap_failed
   7: leo_lang::cli::commands::check_balance
   8: leo_lang::cli::commands::deploy::handle_deploy
   9: <leo_lang::cli::commands::deploy::Deploy as leo_lang::cli::commands::Command>::apply
  10: leo_lang::cli::commands::Command::try_execute
  11: leo_lang::cli::cli::run_with_args
  12: scoped_tls::ScopedKey<T>::set
  13: leo::main
  14: std::sys_common::backtrace::__rust_begin_short_backtrace
  15: std::rt::lang_start::{{closure}}
  16: std::rt::lang_start_internal
  17: main
  18: <unknown>
  19: __libc_start_main
  20: _start

Expected Behavior

No panic

Your Environment

  • leo 1.12.0
  • rustc 1.79.0
  • ubuntu 22.04

KVolodin avatar Jun 23 '24 20:06 KVolodin