Skip to content

Commit 73c231d

Browse files
committed
GetOffers bugfix
1 parent 4b8c0a5 commit 73c231d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

mytoncore.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,9 +2185,9 @@ def GetOffers(self):
21852185
item["hash"] = hash
21862186
item["endTime"] = subdata[0] # *expires*
21872187
item["critFlag"] = subdata[1] # *critical*
2188-
item["config"]["id"] = subdata[2][0] # *param_id*
2189-
param_val = subdata[2][1] # *param_val*
2190-
item["config"]["value"] = param_val
2188+
param_id = subdata[2][0] # *param_id*
2189+
item["config"]["id"] = param_id
2190+
item["config"]["value"] = subdata[2][1] # *param_val*
21912191
item["config"]["hash"] = subdata[2][2] # *param_hash*
21922192
item["vsetId"] = subdata[3] # *vset_id*
21932193
item["votedValidators"] = subdata[4] # *voters_list*
@@ -2202,7 +2202,10 @@ def GetOffers(self):
22022202
item["weightRemaining"] = weightRemaining
22032203
item["approvedPercent"] = round(availableWeight / totalWeight * 100, 3)
22042204
item["isPassed"] = (weightRemaining < 0)
2205-
item["pseudohash"] = hashlib.sha256(param_val.encode()).hexdigest()
2205+
#item["pseudohash"] = hashlib.sha256(param_val.encode()).hexdigest()
2206+
config_val = self.GetConfig(param_id)
2207+
pseudohash_bytes = hash.encode() + json.dumps(config_val, sort_keys=True).encode()
2208+
item["pseudohash"] = hashlib.sha256(pseudohash_bytes).hexdigest()
22062209
offers.append(item)
22072210
#end for
22082211
return offers

0 commit comments

Comments
 (0)