@@ -1428,7 +1428,8 @@ def ElectionEntry(self, args=None):
14281428 #end if
14291429
14301430 # Get ADNL address
1431- adnlAddr = self .GetAdnlAddr ()
1431+ adnl_addr = self .GetAdnlAddr ()
1432+ adnl_addr_bytes = bytes .fromhex (adnl_addr )
14321433
14331434 # Check wether it is too early to participate
14341435 if "participateBeforeEnd" in self .local .db :
@@ -1442,15 +1443,15 @@ def ElectionEntry(self, args=None):
14421443 have_adnl = False
14431444 # Check if ADNL address is in the list
14441445 for a in vconfig .adnl :
1445- if base64 .b64decode (a .id ). hex () == adnlAddr :
1446+ if base64 .b64decode (a .id ) == adnl_addr_bytes :
14461447 have_adnl = True
14471448 break
14481449 if not have_adnl :
14491450 raise Exception ('ADNL address is not found' )
14501451
14511452 # Check if election entry already completed
14521453 entries = self .GetElectionEntries ()
1453- if adnlAddr in entries :
1454+ if adnl_addr in entries :
14541455 self .local .add_log ("Elections entry already completed" , "info" )
14551456 return
14561457 #end if
@@ -1468,32 +1469,32 @@ def ElectionEntry(self, args=None):
14681469 validatorPubkey_b64 = self .GetPubKeyBase64 (validatorKey )
14691470
14701471 # Attach ADNL addr to validator
1471- self .AttachAdnlAddrToValidator (adnlAddr , validatorKey , endWorkTime )
1472+ self .AttachAdnlAddrToValidator (adnl_addr , validatorKey , endWorkTime )
14721473
14731474 # Get max factor
14741475 maxFactor = self .GetMaxFactor ()
14751476
14761477 # Create fift's. Continue with pool or walet
14771478 if usePool :
1478- var1 = self .CreateElectionRequest (pool , startWorkTime , adnlAddr , maxFactor )
1479+ var1 = self .CreateElectionRequest (pool , startWorkTime , adnl_addr , maxFactor )
14791480 validatorSignature = self .GetValidatorSignature (validatorKey , var1 )
1480- validatorPubkey , resultFilePath = self .SignElectionRequestWithPoolWithValidator (pool , startWorkTime , adnlAddr , validatorPubkey_b64 , validatorSignature , maxFactor , stake )
1481+ validatorPubkey , resultFilePath = self .SignElectionRequestWithPoolWithValidator (pool , startWorkTime , adnl_addr , validatorPubkey_b64 , validatorSignature , maxFactor , stake )
14811482
14821483 # Send boc file to TON
14831484 resultFilePath = self .SignBocWithWallet (wallet , resultFilePath , pool .addrB64 , 1.3 )
14841485 self .SendFile (resultFilePath , wallet )
14851486 else :
1486- var1 = self .CreateElectionRequest (wallet , startWorkTime , adnlAddr , maxFactor )
1487+ var1 = self .CreateElectionRequest (wallet , startWorkTime , adnl_addr , maxFactor )
14871488 validatorSignature = self .GetValidatorSignature (validatorKey , var1 )
1488- validatorPubkey , resultFilePath = self .SignElectionRequestWithValidator (wallet , startWorkTime , adnlAddr , validatorPubkey_b64 , validatorSignature , maxFactor )
1489+ validatorPubkey , resultFilePath = self .SignElectionRequestWithValidator (wallet , startWorkTime , adnl_addr , validatorPubkey_b64 , validatorSignature , maxFactor )
14891490
14901491 # Send boc file to TON
14911492 resultFilePath = self .SignBocWithWallet (wallet , resultFilePath , fullElectorAddr , stake )
14921493 self .SendFile (resultFilePath , wallet )
14931494 #end if
14941495
14951496 # Save vars to json file
1496- self .SaveElectionVarsToJsonFile (wallet = wallet , account = account , stake = stake , maxFactor = maxFactor , fullElectorAddr = fullElectorAddr , startWorkTime = startWorkTime , validatorsElectedFor = validatorsElectedFor , endWorkTime = endWorkTime , validatorKey = validatorKey , validatorPubkey_b64 = validatorPubkey_b64 , adnlAddr = adnlAddr , var1 = var1 , validatorSignature = validatorSignature , validatorPubkey = validatorPubkey )
1497+ self .SaveElectionVarsToJsonFile (wallet = wallet , account = account , stake = stake , maxFactor = maxFactor , fullElectorAddr = fullElectorAddr , startWorkTime = startWorkTime , validatorsElectedFor = validatorsElectedFor , endWorkTime = endWorkTime , validatorKey = validatorKey , validatorPubkey_b64 = validatorPubkey_b64 , adnlAddr = adnl_addr , var1 = var1 , validatorSignature = validatorSignature , validatorPubkey = validatorPubkey )
14971498
14981499 self .local .add_log ("ElectionEntry completed. Start work time: " + str (startWorkTime ))
14991500 #end define
0 commit comments