From db2b6eff6f46150d684208e3be8d27dba29e05d0 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 8 Mar 2024 00:59:59 +0300 Subject: [PATCH] dev@locazia: add deploy platform option --- app/core/_blockchain/ton/platform.py | 5 +++-- app/core/background/ton_service.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/core/_blockchain/ton/platform.py b/app/core/_blockchain/ton/platform.py index 29e6a1e..ea199d4 100644 --- a/app/core/_blockchain/ton/platform.py +++ b/app/core/_blockchain/ton/platform.py @@ -1,14 +1,15 @@ from tonsdk.boc import Cell from tonsdk.utils import Address +import os from app.core._blockchain.ton.contracts.blank import Blank from app.core._blockchain.ton.contracts.cop_nft import COP_NFT from app.core._blockchain.ton.contracts.platform import Platform -from app.core._config import TESTNET, MY_PLATFORM_CONTRACT, PROJECT_HOST +from app.core._config import MY_PLATFORM_CONTRACT, PROJECT_HOST from app.core._secrets import service_wallet kwargs = {} -if TESTNET is False: +if int(os.getenv('INIT_DEPLOY_PLATFORM_CONTRACT', 0)) == 0: kwargs['address'] = Address(MY_PLATFORM_CONTRACT) platform = Platform( diff --git a/app/core/background/ton_service.py b/app/core/background/ton_service.py index c827d4e..d0b4f3e 100644 --- a/app/core/background/ton_service.py +++ b/app/core/background/ton_service.py @@ -16,7 +16,7 @@ async def get_sw_seqno(): if sw_seqno_result.get('exit_code', -1) != 0: sw_seqno_value = 0 else: - sw_seqno_value = int(sw_seqno_result.get('stack', [['num', '0x0']])[0][1].replace('0x', ''), 16) + sw_seqno_value = int(sw_seqno_result.get('stack', [['num', '0x0']])[0][1], 16) return sw_seqno_value