Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TESTCOV: Sputnik DAO: View Functions #128

Open
20 tasks
TrevorJTClarke opened this issue Feb 25, 2022 · 2 comments
Open
20 tasks

TESTCOV: Sputnik DAO: View Functions #128

TrevorJTClarke opened this issue Feb 25, 2022 · 2 comments
Labels
C-Testing Unit testing / integration testing P-Low Priority: Low

Comments

@TrevorJTClarke
Copy link
Contributor

Create test coverage for the following:

Views

version

  • Returns the version of this contract.

get_config

  • Returns the config of this contract.

get_policy

  • Returns policy of this contract.

get_staking_contract

  • Returns the staking contract if available. Otherwise returns None.

has_blob

  • Returns whether the blob with given hash is stored.

get_locked_storage_amount

  • Returns the locked amount of NEAR that is used for the storage.

get_available_amount

  • Returns the available amount of NEAR that can be spent (outside of the amount for the storage and bonds).

delegation_total_supply

  • Returns the total delegated stake.

delegation_balance_of

  • Returns the delegated stake of the given account.

delegation_balance_ratio

  • Combines the balance and the total amount for calling from external contracts.

get_last_proposal_id

  • Returns the last proposal's id.

get_proposals

  • Returns a vector of the proposals.

get_proposal

  • Returns the specific proposal by id.
    • Should panic if the proposal with the given id doesn't exist

get_bounty

  • Returns the specific bounty by id.
    • Should panic if the bounty with the given id doesn't exist

get_last_bounty_id

  • Returns number of the bounties.

get_bounties

  • Returns the bounties.

get_bounty_claims

  • Returns bounty claims for given user.

get_bounty_number_of_claims

  • Returns the number of claims per given bounty.
@TrevorJTClarke TrevorJTClarke added P-Low Priority: Low C-Testing Unit testing / integration testing labels Feb 25, 2022
@GaloisField2718
Copy link

Hello,

Can you detail arguments needed by functions.

Apparently has_blob require hash field, but hash of what ?

@GaloisField2718
Copy link

For get_last_proposal_id if it's return n, to get this proposal the id is n-1.
So I think we can decrement get_proposal_id to have directly the right id.
I don't know what file determine this functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Testing Unit testing / integration testing P-Low Priority: Low
Projects
Status: No status
Development

No branches or pull requests

2 participants