fix for the proposal id parsing
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
564cf0dd5c
commit
c37f8da040
6
main.py
6
main.py
@ -5,6 +5,7 @@ import logging
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from web3 import Web3
|
||||
from eth_abi.abi import decode
|
||||
from aiogram import types, Bot
|
||||
from aiogram.utils.keyboard import InlineKeyboardBuilder
|
||||
|
||||
@ -83,8 +84,9 @@ class EventBot:
|
||||
bond_id = int(log["topics"][1].hex(), 16)
|
||||
button_url += str(bond_id)
|
||||
elif event_name == "ProposalCreated":
|
||||
proposal_id = int(log["topics"][1].hex(), 16)
|
||||
button_url += str(proposal_id)
|
||||
decoded_data = log.get("data", b"")
|
||||
proposal_id = decode(['uint256'], decoded_data[:32])[0]
|
||||
button_url += f"0x{proposal_id:x}"
|
||||
|
||||
button.add(types.InlineKeyboardButton(
|
||||
text=msgs["button_text"],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user