Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Redeem rb set into components #346

Merged
merged 9 commits into from Jan 15, 2019
Merged

Conversation

felix2feng
Copy link
Contributor

@felix2feng felix2feng commented Jan 14, 2019

Changelog

  • Fix some of the interfaces for ISetToken and IRebalancingSetToken
  • Added parameter and renamed RedeemAndWithdrawTo
  • Wrote redeemRBSetIntoBaseComponents function and module
  • Unit tested module

address(this)
);

require(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@asoong Instead of that funky return baseSet in the payableExchangeIssue function, we could do something like a require where the input issue or rebalance quantity needs to work

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I like this better, with the tradeoff being issuance quantity granularity?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, let's get some scenario tests for this up to better understand how this affects issuances, especially after rebalances

Copy link
Contributor

@asoong asoong left a comment

Choose a reason for hiding this comment

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

LGTM

baseSetAddress,
msg.sender,
baseSetRedeemQuantity,
0
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we want to forward the toExclude property up too? On setProtocol.js we can default it to 0

* @param _rebalancingSetAddress Address of the rebalancing Set to redeem
* @param _redeemQuantity The Quantity of the rebalancing Set to redeem
*/
function redeemRBSetIntoBaseComponents(
Copy link
Contributor

Choose a reason for hiding this comment

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

Still dislike the RB abbreviation, prefer rebalancing spelled out

address(this)
);

require(
Copy link
Contributor

Choose a reason for hiding this comment

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

+1, let's get some scenario tests for this up to better understand how this affects issuances, especially after rebalances

baseSetComponent = await erc20Wrapper.deployTokenAsync(ownerAccount);
await erc20Wrapper.approveTransferAsync(baseSetComponent, transferProxy.address);

// Create the Set (1 component)
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests work fine to verify basic domain logic, definitely need better examples with scenario tests

});

describe('#redeemRBSetIntoBaseComponents', async () => {
const subjectCaller: Address = functionCaller;
Copy link
Contributor

Choose a reason for hiding this comment

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

I've moved away from initializing anything when declaring variables, prefer all the values to be set together

let subjectRedeemQuantity: BigNumber;

let baseSetIssueQuantity: BigNumber;
const baseSetComponentUnit: BigNumber = new BigNumber(10 ** 10);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

@coveralls
Copy link

coveralls commented Jan 15, 2019

Pull Request Test Coverage Report for Build 3705

  • 10 of 10 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 3686: 0.0%
Covered Lines: 779
Relevant Lines: 779

💛 - Coveralls

@felix2feng felix2feng merged commit 0a0d899 into master Jan 15, 2019
@felix2feng felix2feng deleted the redeem-rb-set-into-components branch January 15, 2019 01:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants