disintar / toncli

TON Command Line Interface - easy smart contract manipulation
https://disintar.io/
Apache License 2.0
166 stars 34 forks source link

Error during deploy with toncli from master #55

Closed BorMor closed 2 years ago

BorMor commented 2 years ago

I've tried to use master branch toncli for new tests According to documentation it has to be used with https://github.com/SpyCheese/ton/tree/toncli-local binaries

toncli start wallet
cd wallet/
toncli build
toncli deploy

But it produces error

INFO: 🚀 You want to interact with your contracts ['contract'] in testnet - that's great!
INFO: ✋ Do not panic - i'm creating wallet in /root/.config/toncli, so you can easily manage your contracts
INFO: 🐒 I'll create folder /root/.config/toncli/wallet with project wallet and all needed files
INFO: 👑 Folder successfully created - happy blockchain hacking
INFO: 🐼 You now can do cd wallet and toncli deploy -n testnet
INFO: 🤗 Run tests on ['/root/.config/toncli/wallet/fift/data.fif']
Saved new private key to file build/contract.pk
INFO: Depth test pass 🏁
INFO: Type test pass 🏁
INFO: 🥳 Start contract manipulation
[ 1][t 0][2022-08-13 07:01:54.680287875][Fift.cpp:67]   top: <text interpreter continuation>
level 1: <continuation 0x55b003be1350>
level 2: <text interpreter continuation>
[ 1][t 0][2022-08-13 07:01:54.680300085][fift-main.cpp:204]     Error interpreting file `/toncli/src/toncli/modules/fift/contract_manipulation.fif`: contract.fif:15:   PROCINLINE:<{:-?
Traceback (most recent call last):
  File "/usr/local/bin/toncli", line 33, in <module>
    sys.exit(load_entry_point('toncli', 'console_scripts', 'toncli')())
  File "/toncli/src/toncli/main.py", line 60, in main
    CommandsExecuter(command, string_kwargs, parser)
  File "/toncli/src/toncli/modules/utils/commands/commands_executer.py", line 39, in __init__
    self.command_mapper[command](self)
  File "/toncli/src/toncli/modules/utils/commands/commands_executer.py", line 70, in deploy_command
    return DeployCommand(self.string_kwargs, self.parser)
  File "/toncli/src/toncli/modules/utils/commands/command_classes/deploy_command.py", line 12, in __init__
    deployer = ContractDeployer(network=args.net, update_config=args.update,
  File "/toncli/src/toncli/modules/deploy_contract.py", line 43, in __init__
    self.deploy_contract = DeployWalletContract(network, workchain)
  File "/toncli/src/toncli/modules/deploy_wallet_contract.py", line 53, in __init__
    data = self.build()
  File "/toncli/src/toncli/modules/abstract/deployer.py", line 107, in build
    data.append(contract_manipulation(os.path.abspath(contract.to_save_location),
  File "/toncli/src/toncli/modules/utils/fift/commands.py", line 101, in contract_manipulation
    output = subprocess.check_output(command, cwd=getcwd() if not cwd else cwd)
  File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/bin/fift', '-I', '/root/.config/toncli/fift-libs', '-s', '/toncli/src/toncli/modules/fift/contract_manipulation.fif', '/root/.config/toncli/wallet/build/contract.fif', '/tmp/tmpl_82u7g4.boc', '0', '/root/.config/toncli/wallet/build/boc/contract.boc', '/root/.config/toncli/wallet/build/contract_address']' returned non-zero exit status 2.

how to reproduce with docker

docker run --rm -it ubuntu:22.04 bash

apt-get update && apt-get install -y build-essential cmake clang-11 openssl libssl-dev zlib1g-dev openssl wget git python3 python3-pip
git clone --recurse-submodules --jobs 8 --depth 1 --branch toncli-local https://github.com/SpyCheese/ton.git /ton

mkdir /build && cd /build

cmake -DCMAKE_BUILD_TYPE=MinSizeRel /ton
cmake --build . --config MinSizeRel --target func fift lite-client -- -j $(nproc)

cp /build/lite-client/lite-client /build/crypto/fift /build/crypto/func /usr/local/bin/
cd /

git clone --depth 1 https://github.com/disintar/toncli.git
cd toncli
pip install -e .

#specify /usr/local/bin/func /usr/local/bin/fift /usr/local/bin/lite-client
toncli

toncli update_libs

cd /tmp/
toncli start wallet

cd wallet/
toncli deploy
BorMor commented 2 years ago

Issue not related to SpyCheese's toncli-local branch Git bisect shows the problem was initially pushed with

commit 6f3bd97dda72c72b5a95c6b6ca4a54f11f92dd4a
Author: Miroslav Tashonov <miroslavtashonov@gmail.com>
Date:   Thu May 12 17:02:28 2022 +0200

    TONCLI-18 Initial adding of test helper functions
BorMor commented 2 years ago

The problem in https://github.com/disintar/toncli/blob/master/src/toncli/lib/func-libs/math.func inline specifier cause of the error

when I remove math.func or change inline to _inlineref (or fully remove specifier) solve the error

I don't know is it possible to use inline_ref in that context