smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.67k stars 2.89k forks source link

.call() function not working so I 'm not able to receive any data #1891

Open saniam-dxb opened 6 months ago

saniam-dxb commented 6 months ago

My contract deploys, and transactions are working. But when I try to retrieve data with a view function, I get an error saying it's not synced. My project depends on retrieving data, please help me out!

print(funcs.showPDetails().call()) #Error causing line

funcs is declared as contractname.functions & works with transactions

showPDetails() is a view function in the contract with just a return line

Error (end of error messages): web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced?

Browsed the internet, a few people did have this issue but most were unanswered. One suggested solution to add time.sleep(50) did not make a difference for me.