Skip to content

Commit 968437a

Browse files
committed
fixes
fix exceptions rename method fix name
1 parent c34a459 commit 968437a

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

modules/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Setting:
3434
'stake': Setting('validator', None, 'Stake amount'),
3535
'stakePercent': Setting('validator', 99, 'Stake percent if `stake` is null'),
3636
'isSlashing': Setting('validator', None, 'Create complaints to validators'),
37-
'walletName': Setting('validator', None, 'Wallet name'),
37+
'validatorWalletName': Setting('validator', 'wallet_001', 'Validator\'s wallet name'),
3838
'maxFactor': Setting('validator', None, 'Param send to Elector. if null will be taken from 17 config param'),
3939
'participateBeforeEnd': Setting('validator', None, 'Amount of seconds before start of round to participate'),
4040
'liquid_pool_addr': Setting('liquid-staking', None, 'Liquid staking pool address'),

modules/nominator_pool.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def do_activate_pool(self, pool, ex=True):
6363
self.local.add_log("do_activate_pool warning: account status is active", "warning")
6464
else:
6565
validator_wallet = self.ton.GetValidatorWallet()
66-
self.ton.check_account_status(validator_wallet.addrB64)
66+
self.ton.check_account_active(validator_wallet.addrB64)
6767
self.ton.SendFile(pool.bocFilePath, pool, timeout=False, remove=False)
6868
#end define
6969

modules/single_pool.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def do_activate_single_pool(self, pool):
5151
self.local.add_log("start activate_single_pool function", "debug")
5252
boc_mode = "--with-init"
5353
validator_wallet = self.ton.GetValidatorWallet()
54-
self.ton.check_account_status(validator_wallet.addrB64)
54+
self.ton.check_account_active(validator_wallet.addrB64)
5555
result_file_path = self.ton.SignBocWithWallet(validator_wallet, pool.bocFilePath, pool.addrB64_init, 1, boc_mode=boc_mode)
5656
self.ton.SendFile(result_file_path, validator_wallet)
5757

mytoncore/mytoncore.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1866,15 +1866,18 @@ def check_account_balance(self, account, coins):
18661866
if not isinstance(account, Account):
18671867
account = self.GetAccount(account)
18681868
if account.balance < coins:
1869-
raise Exception(f"Wallet {account.addrB64} balance is less than requested coins. Balance: {account.balance}, requested amount: {coins} (need {coins - account.balance} more)")
1869+
raise Exception(f"Account {account.addrB64} balance is less than requested coins. Balance: {account.balance}, requested amount: {coins} (need {coins - account.balance} more)")
18701870
# end if
18711871
# end define
18721872

1873-
def check_account_status(self, account):
1873+
def check_account_active(self, account):
18741874
if not isinstance(account, Account):
1875+
address = account
18751876
account = self.GetAccount(account)
1877+
else:
1878+
address = account.addrB64
18761879
if account.status != "active":
1877-
raise Exception(f"Wallet {account.addrB64} account is uninitialized")
1880+
raise Exception(f"Account {address} account is uninitialized")
18781881
# end if
18791882
# end define
18801883

@@ -1899,7 +1902,7 @@ def MoveCoins(self, wallet, dest, coins, **kwargs):
18991902
# Balance checking
19001903
account = self.GetAccount(wallet.addrB64)
19011904
self.check_account_balance(account, coins + 0.1)
1902-
self.check_account_status(account)
1905+
self.check_account_active(account)
19031906

19041907
# Bounceable checking
19051908
destAccount = self.GetAccount(dest)

0 commit comments

Comments
 (0)