Skip to content

Commit 7a0b02e

Browse files
authored
Merge pull request #590 from yungwine/liquid-staking
remove check_liquid_pool command
2 parents 96c6f6a + d10bcb7 commit 7a0b02e

2 files changed

Lines changed: 0 additions & 43 deletions

File tree

modules/controller.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import time
44

55
from mypylib.mypylib import color_print, print_table
6-
from mytoncore.utils import raw_addr_to_b64
76
from mytonctrl.console_cmd import add_command, check_usage_one_arg, check_usage_two_args, check_usage_args_min_max_len
87

98
from mytonctrl.utils import GetItemFromList
@@ -184,42 +183,6 @@ def add_controller(self, args):
184183
self.do_add_controller(controller_addr)
185184
color_print("AddController - {green}OK{endc}")
186185

187-
def do_check_liquid_pool(self):
188-
liquid_pool_addr = self.ton.GetLiquidPoolAddr()
189-
account = self.ton.GetAccount(liquid_pool_addr)
190-
history = self.ton.GetAccountHistory(account, 5000)
191-
addrs_list = list()
192-
for message in history:
193-
if message.src_addr is None or message.value is None:
194-
continue
195-
src_addr_full = None
196-
if message.src_workchain is not None and message.src_addr is not None:
197-
src_addr_full = f"{message.src_workchain}:{message.src_addr}"
198-
dest_addr_full = None
199-
if message.dest_workchain is not None and message.dest_addr is not None:
200-
dest_addr_full = f"{message.dest_workchain}:{message.dest_addr}"
201-
if src_addr_full == account.addr_full:
202-
fromto = dest_addr_full
203-
else:
204-
fromto = src_addr_full
205-
if fromto is None:
206-
continue
207-
fromto = raw_addr_to_b64(fromto)
208-
if fromto not in addrs_list:
209-
addrs_list.append(fromto)
210-
211-
for controllerAddr in addrs_list:
212-
account = self.ton.GetAccount(controllerAddr)
213-
version = self.ton.GetVersionFromCodeHash(account.codeHash)
214-
if version is None or "controller" not in version:
215-
continue
216-
print(f"check controller: {controllerAddr}")
217-
self.ton.ControllerUpdateValidatorSet(controllerAddr)
218-
219-
def check_liquid_pool(self, args):
220-
self.do_check_liquid_pool()
221-
color_print("CheckLiquidPool - {green}OK{endc}")
222-
223186
def do_calculate_loan_amount_test(self):
224187
min_loan = self.ton.local.db.get("min_loan", 41000)
225188
max_loan = self.ton.local.db.get("max_loan", 43000)
@@ -243,5 +206,4 @@ def add_console_commands(self, console):
243206
add_command(self.local, console, "stop_controller", self.stop_controller)
244207
add_command(self.local, console, "stop_and_withdraw_controller", self.stop_and_withdraw_controller)
245208
add_command(self.local, console, "add_controller", self.add_controller)
246-
add_command(self.local, console, "check_liquid_pool", self.check_liquid_pool)
247209
add_command(self.local, console, "test_calculate_loan_amount", self.calculate_loan_amount_test)

mytonctrl/resources/translate.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,6 @@
274274
"ru": "Добавить контроллер liquid staking к валидатору",
275275
"zh_TW": "將流動質押控制器添加到驗證者"
276276
},
277-
"check_liquid_pool_cmd": {
278-
"en": "Check liquid staking pool",
279-
"ru": "Проверить пул liquid staking",
280-
"zh_TW": "檢查流動質押池"
281-
},
282277
"test_calculate_loan_amount_cmd": {
283278
"en": "Test calculate loan amount for liquid staking controller",
284279
"ru": "Тест рассчета суммы займа для контроллера liquid staking",

0 commit comments

Comments
 (0)