Closed theref closed 1 year ago
I get an error within an alert - so the app logic is probably ok but I'm not sure what's happening:
ExternalError: Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="getBallot(string)", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0) on line 88
Enhanced Ballot Handling in Client Code
Changes have been made in client_code/forms/routes/ballot/Index/__init__.py
to better handle instances when a requested ballot does not exist. This is achieved by adding the session.sync_ballot
function in the show_ballot
method.
Modification of the Ballot Class
The client_code/model.py
file underwent several modifications, notably the relocation of the protocol_version
attribute towards the end of the parameters list in the Ballot
class's __init__
method. The addition of two new methods, __eq__
and __hash__
, also enhance this class's functionality.
Improvements to the Services Manager
The client_code/services/manager.py
file received changes, including updating the address
variable with a new value and incorporating a new ABI function, getBallot
. This function serves to gather information about a specific ballot.
Upgrades in Storage Services
A new method, get_ballot
, was added to the ScrollStore
class within client_code/services/storage.py
. This method's purpose is to fetch a specific ballot from the contract.
Session Updates for Synchronization
The client_code/session.py
file now hosts two new synchronization functions: sync_storage
and sync_ballot
. The former syncs the local store with the scroll store by saving the missing ballots from the scroll store, and the latter syncs a particular ballot from the scroll store to the local store.
Addition of a Ballot Retrieval Function in Ballot Manager Contract
Inside contracts/BallotManager.sol
, a new function getBallot
was added, enabling the retrieval of specific ballot details using its UUID.
To review, push this branch to anvil. Start the app. Your index db should be empty, feel free to create some ballots if you wish.
Add this to end of your url
#?ballot_id=5bc87a3cd30becc542c3a39137f4f632
- it's a ballot i created earlier. It should then populate your index db and the title of the ballot is "new test"Closes #62