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

feat: add getIssuerForBrand to zoe #1276

Merged
merged 13 commits into from
Jul 20, 2020
Merged

Conversation

dtribble
Copy link
Member

@dtribble dtribble commented Jul 9, 2020

closes: #1270

This adds getIssuerForBrand to zcf so that contracts can synchronously get issuers for amounts they receive. (We could add one to get it from an Amount as well.) The also adds type declaration.

This also modifies multipool autoswap to return the issuers etc. when a pool is added, rather than jut an acknowledgement string.

Testing

There is no existing test for getBrandForIssuer. The test for this new operation should be added with that. The operation currently gets ad hoc testing because the subsystem tests or dapp-token-economy relies on it.

The tests for multipool autoswap were updated are updated to accomodate and test that the new return result returns a record with at least some expected fields.

Documentation

This adds a new operation to ZCF, which should be added to the API documentation site.

This changes the return result of creating a multipool autoswap. The previous return was just a worthless string. Now we can get the issuers, etc. That's not currently documented, but could be extended with that information.

@katelynsills
Copy link
Contributor

This looks good. Before merging can we add a unit test and coordinate with @tyg to change the documentation?

Copy link
Contributor

@katelynsills katelynsills left a comment

Choose a reason for hiding this comment

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

I think there are some linting errors and we might need to rebase this on master for only the wanted changes to show. Can we also add unit tests for this and coordinate with Tom on updating the documentation?

@dtribble
Copy link
Member Author

This looks good. Before merging can we add a unit test and coordinate with @tyg to change the documentation?

I don't seem to be able to reply in-line so I'm not sure what lines of code the comments are attached to. I have a lint-fix.

Re unit tests, there aren't currently unit tests for the code I copied from (getBrandForIssuer). Add them to that list! I think we can delay that for the updated API, though.

Re documentation: it's additive. I'll update the PR comment with a doc section. I'm not sure why it didn't offer me a PR template.

@dtribble dtribble requested a review from tyg July 16, 2020 22:08
@dtribble dtribble changed the title feat: add getIssuerFromBrand to zoe feat: add getIssuerForBrand to zoe Jul 16, 2020
@katelynsills
Copy link
Contributor

Added a test, @dtribble do you want to take a look at it? I also asked Chris to review

Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

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

These look like useful helpers. I'm skeptical about adding a helper for the tests and not invoking it anywhere.

@katelynsills
Copy link
Contributor

These look like useful helpers. I'm skeptical about adding a helper for the tests and not invoking it anywhere.

I'm not sure what you mean. zcfTesterContract.js is run as the main part of this test, so everything added is invoked

@Chris-Hibbert
Copy link
Contributor

zcfTesterContract.js is run as the main part of this test, so everything added is invoked

Thanks, I was looking for makeContract and missed that the file was imported explicitly.

@katelynsills katelynsills merged commit 4fe3c83 into master Jul 20, 2020
@katelynsills katelynsills deleted the 1270_getIssuerFromBrand branch July 20, 2020 19:04
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.

Hooks need the issuer for the amounts in the offer
4 participants