Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Copy dutch auction asset data utils to @0x/order-utils #1943

Merged
merged 3 commits into from
Jul 13, 2019

Conversation

xianny
Copy link
Contributor

@xianny xianny commented Jul 11, 2019

Description

Copies to @0x/order-utils encoding and decoding methods for Dutch Auction asset data.

Does not remove the methods from @0x/contract-wrappers as we will deprecate them wholesale later.

Resolves #1933

Testing instructions

Unit tests

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons.

@xianny xianny requested review from fabioberger and feuGeneA July 11, 2019 01:52
@xianny xianny force-pushed the multilang-1933/move-dutch-auction-utils branch from a6453a8 to fadaa17 Compare July 11, 2019 01:53
Copy link
Contributor

@feuGeneA feuGeneA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One little thing, otherwise looks good to me. Thanks for expanding the test coverage a bit!

beginTimeSeconds: new BigNumber(1562807905),
beginAmount: new BigNumber(5),
dutchAuctionAssetData:
'0xf47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000005d268e610000000000000000000000000000000000000000000000000000000000000005',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did this come from? I looked over in contract-wrappers and couldn't find anything analogous.

It would be nice to cite a source in the comments here, either where you copied it from, or how you generated it. Would be even better to do some round trip encoding/decoding testing. Up to you how far to take it, given your intended scope with this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from a unit test run using Ganache in contract-wrappers.
Round trip encoding/decoding sounds useful -- what would it be like in this case? Something other than encoding/decoding the ERC20 asset data + the dutch auction info?

@coveralls
Copy link

coveralls commented Jul 11, 2019

Coverage Status

Coverage increased (+0.02%) to 83.359% when pulling bfa6349 on multilang-1933/move-dutch-auction-utils into 212a2d2 on development.

beginTimeSeconds,
beginAmount,
};
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have the logic in order-utils, which is a dependency of contract-wrappers, let's have the methods in contract-wrappers call these same methods under-the-hood. That way, we still keep it exposed there, but our code remains DRY.

@xianny xianny force-pushed the multilang-1933/move-dutch-auction-utils branch from 8286eb3 to bfa6349 Compare July 12, 2019 19:42
@xianny
Copy link
Contributor Author

xianny commented Jul 12, 2019

Update, I rebased on development and force-pushed to fix test-python, that messed up the earlier commit 9e0acd1 but I didn't make any changes on that commit! It's OK to just review the latest commit.

@xianny xianny requested review from fabioberger and feuGeneA July 12, 2019 22:06
@xianny xianny merged commit 88ae831 into development Jul 13, 2019
@xianny xianny deleted the multilang-1933/move-dutch-auction-utils branch July 13, 2019 00:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move Dutch Auction util methods to order-utils
4 participants