issues
search
near-daos
/
sputnik-dao-contract
Smart contracts for https://app.astrodao.com
https://astrodao.com/
MIT License
108
stars
76
forks
source link
TESTCOV: Sputnik Factory: View Functions
#125
Open
TrevorJTClarke
opened
2 years ago
TrevorJTClarke
commented
2 years ago
Create test coverage for the following:
Views
get_dao_list
[x] Returns empty array for new factory
[x] Returns full list of DAOs
[ ] NOTE: This method will fail when list gets too long for gas to return on RPC
get_number_daos
[x] Returns an integer representing the total amount of DAOs known to factory
get_daos
[ ] (Needs Impl) Returns default list of DAOs with a max length of 100 & offset of 0.
[ ] Returns a list of DAOs matching the specified
from_index
and
limit
.
[ ] Capable of returning non-zero indexed list, so pagination can be verified
get_owner
[x] Returns a string representing the account that owns the factory
[x] Fails if storage is corrupted or no owner
get_default_code_hash
[x] Returns the default code_hash for a new DAO
[ ] Returns the default code_hash that has been updated after new code blob in factory
get_default_version
[x] Returns the default metadata version for a new DAO, this will be a simplified semver. Example: [2,0] for V 2.0
get_code
[x] Returns an entire code blob based on given code_hash
[x] Returns no value if code_hash doesn't exist
get_contracts_metadata
[ ] Returns the supported list of all factory code_hash + metadata, indicating the supported versions available for DAOs to upgrade
Create test coverage for the following:
Views
get_dao_list
get_number_daos
get_daos
from_index
andlimit
.get_owner
get_default_code_hash
get_default_version
get_code
get_contracts_metadata