My smart contract has the following piece of code:
# check if the election has begun. begin and end time must be in the future and in unix timestamp
assert block.timestamp < self.elections[_election_id].begin_unix_timestamp, "The election has already started"
On the block explorer (https://goerli.etherscan.io/tx/0xef2d5fe12514ecfe582e191b97316a4c99f5b24c4213ea0a1940dde179ec8f1e) I can see that the transaction has failed with the error message:
Status: Fail with error 'The election has already started'
How can I access this error message using web3? All I have access to is the status code in the transaction receipt, but not the error message:
signed_transaction = w3.eth.account.sign_transaction(transaction, private_key=goerli_account_private_key)
sent_raw_transaction = w3.eth.send_raw_transaction(signed_transaction.rawTransaction)
receipt = w3.eth.waitForTransactionReceipt(sent_raw_transaction)
print(receipt.status)
# print(some_transaction_object.fail_message) # I'm looking for something like this