-
Notifications
You must be signed in to change notification settings - Fork 1
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
Python Pools Contracts Testing #1
base: master
Are you sure you want to change the base?
Conversation
@kibagateaux Questions for you:
|
|
…ls_sum_of_self_owner_fee_events_emitted.
# @pytest.mark.rev_generator # What does this do? | ||
@given(amount=st.integers(min_value=1, max_value=MAX_UINT)) # min_val = 1 so no off by one when adjusting values | ||
@settings(max_examples=100, deadline=timedelta(seconds=1000)) | ||
def test_self_owner_rev_claimable_by_rev_recipient(pool, admin, amount): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a test for what u wrote here in test_rev_recipient_can_claim_rev
. I want to test that all RevenueGenerated events emitted with self.owner
as the receiver are claimable by rev_recipient
. So should randomly generate fees (any type or just the ones that pay to owner idc) and then test that claimable rev == event amounts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. rewrote the test and created a helper function called gen_rev_events
that calls different functions (mint
, deposit
, redeem
, withdraw
, etc) that log the RevenueGenerated
event.
…aimable by rev_recipient.
…_owner_fee_events_emitted
|
Both tests are iterating through
|
ya interesting. gen_rev was really only made to test the different fee types, not every single 4626 function. So might have to manually call deposit/withdraw, mint/redeem, and collect interest for this test |
…nctions along with others.
Description
test_RevenueGeneratingContracts
(2, 3, 5) with name formattest_funcName_invariant_{name_of_test}
Future Work:
test_pool_share_price.py
_virtual_apr
in VyperTODO_TEST
comments in smart contractsRelated Issue
Python Pools Contracts Testing
Motivation and Context
Help Kiba with testing Pools contracts.
How Has This Been Tested?
Running
pytest tests/boa/pool/test_RevenueGeneratingContract.py -m "not slow"
locally.Screenshots (if appropriate):