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

refactor OPCCollector #643

Merged
merged 4 commits into from
May 17, 2022
Merged

refactor OPCCollector #643

merged 4 commits into from
May 17, 2022

Conversation

alexcos20
Copy link
Member

Closes #641

@alexcos20 alexcos20 added this to the V4 milestone May 16, 2022
@alexcos20 alexcos20 self-assigned this May 16, 2022
@alexcos20 alexcos20 marked this pull request as ready for review May 16, 2022 13:35
@alexcos20 alexcos20 requested a review from trentmc as a code owner May 16, 2022 13:35
@alexcos20 alexcos20 merged commit 828f77b into v4main May 17, 2022
@alexcos20 alexcos20 deleted the feature/refactor_OPCCollector branch May 17, 2022 04:52
MantisClone pushed a commit to oceanprotocol/ocean.py that referenced this pull request May 19, 2022
calina-c pushed a commit to oceanprotocol/ocean.py that referenced this pull request May 30, 2022
* Add more TEST_PRIVATE_KEYs, refactor helper method for getting wallets
* Create test_fees.py. Begin adding publish flow (with fees)
* Change default encrypt_flag and compress_flag to True
* Add missing FactoryRouter methods. Remove duplicate Ocean.dispenser func
* Add utilities to Ocean
* Fix type returned from OCEAN_token
* Add market_fee_collector argument to Ocean.create_pool
* Add PublishMarketFee back into ERC20Token
* Remove argument from BPool.getOPCFee
* Switch publisher and consumer wallets in test_swap_fees.py::test_ocean_pool
* [WIP] tests/flows/test_swap_fees.py::test_pool["Ocean"] is passing.
* Parameterize test_swap_fees.py::test_pool to work with OCEAN and DAI
* Fix comments, add assertions from test_pool_dai
* Start fixing test_pool so that it can work with USDC
* Fix to_wei and from_wei tests in test_currency.py
* Fix to_wei and from_wei
* Test that to_wei and from_wei can handle MAX_USDT
* Update normalize_and_validate_ether to handle MAX_USDT
* Add parse_units and format_units (similar to ethers.js)
* Fix argument names for parse_units
* Fix format_units.  Still working on parse_units
* Update parse_units and format_units tests. Refactor and simplify format_units
* Fix parse_units
* Add tests for named units like "mwei"
* Add from_wei and format_units to the Ocean API
* Fix places where to_wei was used with 2 arguments. Also pre-commit fixes
* Intermediary commit. Continue improving test_swap_fees.py::test_pool
* Intermediary Commit, finished buy_dt_exact_amount_in
* Fix buy_dt_exact_amount_out
* Implement buy_bt_exact_amount_in
* Remove "flexible" tests, identical to other tests.
* Add missing call for buy_bt_exact_amount_out.  Fix allowances.
* Fix arg names
* Remove test cases related to joining/exiting pool.
  * These joins and exits are already tested in test_side_staking.py
  * The tests in test_side_staking.py are more complete than these.
  * No swap fees are collected when joining/exiting a pool.
* Remove test_pool_dai and test_pool_usdc.
  * Replaced by test_pool["MockDAI"] and test_pool["MockUSDC"]
* Add consume market fee to swap fees tests, make tests more flexible
* All parameterized swap fee tests passing
* Move erc721 add manager test to test_erc721_factory.py
* Reorganize test_swap_fees.py
* Fix test_swap_fees_fuzzing.py, use to_wei and from_wei
* Rename several argument names
* Reoganize test cases
* Add max fees tests
* Tweak happy path fee amounts
* Tweak test and function names
* Relax relative approximations for fee amounts
* Add test_exchange_swap_fees
* Add tests for min and max rate for pools
* Call get_event_log on ERC20Token instead of FactoryRouter
* Circumvent swap fees by joining and exiting a pool
* Move "swap" via join/exit up so it happens before the swaps
* Move "swap" via join/exit below the approval
* Check that balance before and after are equal, instead of checking for 0
* Update swap fees test to better show how to circumvent swap fees
* Enable logging output in tests
* Update swap fees test with more info about bug to circumvent swap fees
* Fix pytest.yml so it actually prints logs
* Finish buy DT and sell DT portions of exchange swap fee tests
* Add test cases for exchanges with rate = MIN_RATE and large rate
* Add collect_bt and TODOs
* Generalize collect BT/DT
* Add collect_fee_and_verify_balances
* Rearrange functions, Refactor
* Add update_market_fee test
* Update to contracts alpha version 30
* Remove test case for circumventing fees.
  * No longer possible because joinPool and exitPool methods removed.
* Add test cases for with_mint=0
* Consolidate duplicate base_tokens_to_datatokens method, rename variables
* Add test cases for collecting publisher swap fees and opc swap fees
* Uncomment low rate pool swap fee tests
* Remove all uses of joinPool and exitPool
* Add test_multiple_pools.py
* Add test cases for updating fees and fee collectors (pool and exchange)
  * Remove a couple redundant MockDAI test cases, to reduce testing time
* Add assertions for changing rate, fees, and fee collectors.
  * Fix bug that calculated too high dt amount to buy from exchange.
* Update bfactory.py to match contract.  (newBPool is internal so removed)
* Remove test_fees.py
* Rename staking to side_staking
* Remove get_current_nft_count test from test_erc20_token.py
  * Duplicate. Already tested in test_erc721_factory.py
* Remove get_nft_template test from test_erc20_token.py
  * Duplicate. Already tested in erc721_token.py
* Refactory ERC20 and ERC721 tests. Begin updating test_consume_flow
* Turn off logging in CI
* Reorder operations to match assertions
* Update test_consume_flow, also skip it for now.
* Fix remove_from_725_store_list (was calling removeFromCreateERC20List)
* Fix string comparison, unskip consume flow tests
* When creating download path, make intermediate directories
* Fix consume flow tests to include checking fees
* Copy test_consume_flow.py to test_start_order_fees.py
* Finish test_order_fees.py
* Remove fee-related logic from test_consume_flow.py
* Move fixtures to conftest.py
* Update side staking steal test
* Fix publisher rugpull test
* Make sure publisher sells datatokens before rugpulling
* Update README because encrypt/compress is True by default now.
* Add missing factory_router tests
* Updates related to opcCollector refactor
  * See for details: oceanprotocol/contracts#643
* Continue refactoring due to opcCollector refactor
* Use erc20_token fixture instead of using deploy_erc721_erc20
* More fixes related to opcCollector refactor
* Use MAX_UINT256 instead of MAX_INT256

  * The cap is hardcoded to MAX_UINT256 inside the contracts so the
    actual value passed doesn't matter.  But we make it MAX_UINT256
    for consistency.

* Move description of encrypt/compress flags to publish-flow.md
* Add constants for testing approved and not approved swap fees
* Refresh BPool and BToken and add BConst. Remove balancer_constants.py
* Refactor tests to use ocean.OCEAN_token or ocean.OCEAN_address
  * Create OCEAN_token and OCEAN_address fixtures for tests that don't
    use ocean fixtures.
* Add FilesType base class for UrlFile and IpfsFile
* Move test_opc_collector because because it'a factory_router method now
  * Used to be a BFactory method
* Adjust inheritance tree
  * ContractBase
    * BConst
      * BFactory
        * FactoryRouter
      * BTokenBase
        * BPool
* Rename btoken method from name to token_name
* Add test_bconst.py
* Add calc_in_given_out and calc_out_given_in. Add test_swap_calculations
* Rearrange test, and fix variable names to better illustrated issue
* Parameterize test_swap_calculations
* Change warning to info
* Extract logic for creating asset with order fee into reusable function
* Add timeout argument to create_asset_with_order_fee
  * Rename to create_asset_with_order_fee_and_timeout
* Add test_reuse_order_fees.py
* Consolidate get_provider_fees methods into 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OPF Collector: Refactor
1 participant