314 Commits

Author SHA1 Message Date
Lawrence Forman
3e8f9a6b53 Cherry-pick changes from feat/dev-utils/dydx-bridge-validation 2020-02-07 22:10:10 -05:00
Michael Zhu
2f9891f0aa fix CI failures 2019-12-10 00:32:48 -08:00
Michael Zhu
4663eec950 Add function assertions required for staking rewards fuzzing: withdrawDelegatorRewards, finalizePool, and endEpoch. Also adds payProtocolFee-related assertions to fillOrder 2019-12-09 23:45:37 -08:00
Xianny
fcbcbac889
Remove assetDataUtils everywhere (#2373)
* remove assetDataUtils everywhere

* export IAssetDataContract from @0x/contract-wrappers to allow @0x/instant to decode asset data  synchronously

* export generic function `decodeAssetDataOrThrow` and add ERC20Bridge support

* export `hexUtils` from order-utils instead of contracts-test-utils
2019-12-04 13:08:08 -08:00
Jacob Evans
389d4d10f1
Import from @0x/utils 2019-11-27 13:02:37 +11:00
Jacob Evans
ad8caa2b51
Remove moved RevertErrors 2019-11-27 11:52:14 +11:00
Alex Towle
d5e6b38450 Added unit tests for Authorizable 2019-11-24 22:55:17 -06:00
Alex Towle
4e50b9b479 @0x:contracts-integrations Refactored match_orders_test 2019-11-18 17:56:07 -08:00
Alex Towle
f8b7b8cc28 @0x:contracts-integrations Made an initial refactor of MatchOrderTester 2019-11-18 17:56:07 -08:00
F. Eugene Aumson
f11d8a5bd8
@0x/order-utils refactors for v3: orderParsingUtils, signatureUtils, orderHashUtils, RevertErrors, transactionHashUtils (#2321)
* move orderParsingUtils from order-utils to connect

* Remove many functions from signatureUtils

Removed from the exported object, that is.  All of them are used in
other existing code, so they were all moved to be as local to their
usage as possible.

* remove orderHashUtils.isValidOrderHash()

* Move all *RevertErrors from order-utils...

...into their respective @0x/contracts- packages.

* Refactor @0x/order-utils' orderHashUtils away

- Move existing routines into @0x/contracts-test-utils

- Migrate non-contract-test callers to a newly-exposed getOrderHash()
method in DevUtils.

* Move all *RevertErrors from @0x/utils...

...into their respective @0x/contracts- packages.

* rm transactionHashUtils.isValidTransactionHash()

* DevUtils.sol: Fail yarn test if too big to deploy

* Refactor @0x/order-utils transactionHashUtils away

- Move existing routines into @0x/contracts-test-utils

- Migrate non-contract-test callers to a newly-exposed
getTransactionHash() method in DevUtils.

* Consolidate `Removed export...` CHANGELOG entries

* Rm EthBalanceChecker from devutils wrapper exports

* Stop importing from '.' or '.../src'

* fix builds

* fix prettier; dangling promise

* increase max bundle size
2019-11-14 17:14:24 -05:00
Xianny
f0d7d10fe7
update abi-gen with new method interfaces (#2325)
* update abi-gen with new method interfaces

* wip: get all packages to build

* wip: get all packages to build

* Fix two contract wrapper calls

* Export necessary types part of the contract wrapper public interfaces

* Revive and fix wrapper_unit_tests

* Remove duplicate type

* Fix lib_exchange_rich_error_decoder tests

* Fix remaining test failures in contracts-* packages

* Prettier fixes

* remove transactionHelper

* lint and update changelogs

* Fix prettier

* Revert changes to reference docs

* Add back changelog already published and add revert changelog entry

* Add missing CHANGELOG entries

* Add missing comma

* Update mesh-rpc-client dep

* Update Mesh RPC logic in @0x/orderbook to v6.0.1-beta

* Align package versions
2019-11-14 11:22:29 -05:00
Amir Bandeali
f61964676a Add test for when operatorShare == 0 2019-11-13 09:48:04 -08:00
Amir Bandeali
d90810d127 Add tests for setting operator share to 100% 2019-11-12 22:42:55 -08:00
fabioberger
fc824b8d06 Fix prettier issues 2019-11-12 11:35:34 +00:00
fabioberger
30d54407e6 Fix remaining imports 2019-11-12 10:13:25 +00:00
fabioberger
6324a92ec5 Refactor contracts-* exports so none in test dir so npmignore works as intended 2019-11-11 21:49:29 +00:00
fabioberger
86b76a3e75 Introduce publicFacingContracts config in all package.jsons, refactor all imports from src in contracts packages 2019-11-11 15:10:15 +00:00
fabioberger
f011be9347 Update all contracts-*is package.json, tsconfig.json, compiler.json, artifacts/ts and wrappers.js 2019-11-10 23:41:56 +00:00
Xianny
6a852ab0ed
Replace assetDataUtils with DevUtilsContract wherever possible (#2304)
* Replace assetDataUtils with DevUtilsContract wherever possible

Does not replace from @0x/instant and some @0x/order-utils uses

* Add revertIfInvalidAssetData to LibAssetData

This is needed to replace `assetDataUtils.decodeAssetDataOrThrow`.
Because it's used in packages and not only contracts, we should wait
to deploy the updated contract so we can update `@0x/contract-artifacts`,
`@0x/abi-gen-wrappers`, and `@0x/contract-wrappers` first.

* remove usages of signatureUtils

* fix test for  optimised encoding

* refactor @0x/contracts-integrations

* update changelogs

* Move @0x/contracts-dev-utils from devDependencies to dependencies
It is exported as part of the package
2019-11-06 19:40:20 -08:00
Greg Hysen
68656c4083 Fixes intermittent test failure by removing block timestamp contraints from staking scheduler tests 2019-11-05 16:57:37 -08:00
Greg Hysen
a7f0717afb Unit tests for MixinCumulativeRewards 2019-11-05 15:32:04 -08:00
Greg Hysen
9b2231ed24 Improved readability on some tests + updated staking changelog 2019-11-05 14:59:55 -08:00
Greg Hysen
c123200f38 Unit tests for MixinScheduler 2019-11-04 15:44:46 -08:00
Lawrence Forman
47e050cbaf
Merge pull request #2312 from 0xProject/feat/contracts/staking/MixinStakingPoolRewards-unit-tests
MixinStakingPoolRewards unit tests
2019-11-04 17:19:03 -05:00
Lawrence Forman
c957b48281 @0x/contracts-staking: Run prettier. 2019-11-04 11:10:07 -05:00
Lawrence Forman
c15c5e12b0 @0x/contracts-staking: Fix event name collision in MixinStakingPoolRewards unit tests. 2019-11-04 11:09:21 -05:00
Lawrence Forman
15c3c8074c @0x/contracts-staking: Add separate unit tests for withdrawDelegatorRewards() and _withdrawAndSyncDelegatorRewards(). 2019-11-04 10:43:37 -05:00
Lawrence Forman
cba72c811d @0x/contracts-staking: Add _computePoolRewardsSplit() tests to MixinStakingPoolRewards unit tests. 2019-11-04 10:43:37 -05:00
Lawrence Forman
28a2e56003 @0x/contracts-staking: Add more MixinStakingPoolRewards unit tests. 2019-11-04 10:43:37 -05:00
Lawrence Forman
8c4c3d56c6 @0x/contracts-staking: Create MixinStakingPoolRewards unit tests. 2019-11-04 10:43:37 -05:00
Lawrence Forman
4f56d68689 @0x/contracts-staking: Fix overflow w/ LibFixedMath._mul(-1, -2*255). 2019-11-01 13:35:23 -04:00
Greg Hysen
3a1c464543 Readability improvements to Staking Proxy unit tests + one extra case 2019-11-01 09:59:17 -07:00
Greg Hysen
7bfbf0ad3a Staking Proxy unit tests + Staking Proxy fallback reverts if no staking contract is attached 2019-10-31 18:22:49 -07:00
Lawrence Forman
a02892cbc8 @0x/contracts-staking: Remove duplicated test case in MixinStakeBalances unit tests. 2019-10-29 07:37:06 -04:00
Lawrence Forman
49c67fbb18 @0x/contracts-staking: Remove unused lodash import and only modifier from MixinStakeBalances unit tests. 2019-10-29 07:37:06 -04:00
Lawrence Forman
6f2e79208a @0x/contracts-staking: Add MixinStakeBalances unit tests. 2019-10-29 07:37:06 -04:00
Greg Hysen
9c181f09ba Removed LibProxy and inlined proxy call in StakingProxy. 2019-10-28 16:42:52 -07:00
Amir Bandeali
f246314b1d Update default alpha from 1/2 to 2/3 2019-10-27 16:53:57 -07:00
Amir Bandeali
33a0c22021 Remove tests related to read-only mode 2019-10-27 11:12:22 -07:00
Lawrence Forman
b1b1162b60 @0x/contracts-staking: Add MixinStakingPool unit tests. 2019-10-25 10:55:03 -04:00
Greg Hysen
cc7452da8f Replaced protocolFeePaid -> protocolFeeAmount. Changed some wording in comments. 2019-10-24 15:58:18 -07:00
Lawrence Forman
703e890918 @0x/contracts-staking: Call StakingProxy.assertValidStorageParams() in MixinParams.setParams() 2019-10-23 04:40:47 -04:00
Greg Hysen
c676ecb8cf Force no-op when moving zero stake or moving from undelegated to undelegated. 2019-10-22 15:39:24 -07:00
Greg Hysen
c44e16a88f Removed assertion that protocol fee != 0 from staking contract. 2019-10-22 12:42:04 -07:00
Greg Hysen
22e39f782f Some (more) readability improvements and minor optimizations to staking finalization. 2019-10-22 12:09:18 -07:00
Greg Hysen
d91a7fc663 Some readability improvements and minor optimizations to staking finalization. 2019-10-22 11:02:25 -07:00
Greg Hysen
ce8fd44234 Removed lingering references to stale terminology ("active pools") 2019-10-22 11:02:25 -07:00
Greg Hysen
6617ad9531 Refactored finalization state.
1. Removes state variables:
   - totalWeightedStakeThisEpoch
   - totalFeesCollectedThisEpoch
   - numActivePoolsThisEpoch

2. No longer indexes by epoch % 2

3. Renamed event StakingPoolActivated → StakingPoolEarnedRewards.

4. Renamed structs:
   - ActivePool → PoolStats. This holds stats for a pool that earned rewards.
   - UnfinalizedState → AggregatedStats. This aggregates stats from the former struct.
2019-10-22 11:02:25 -07:00
Amir Bandeali
359b804001 Add test for withdrawing rewards before epoch is finalized 2019-10-21 22:27:06 -07:00
Amir Bandeali
44dac2cd80 Fix tests that assume touching stake will finalize pool 2019-10-21 22:27:06 -07:00