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

getInputPrice with a empty amount throws #2760

Closed
dtribble opened this issue Mar 30, 2021 · 0 comments · Fixed by #2762
Closed

getInputPrice with a empty amount throws #2760

dtribble opened this issue Mar 30, 2021 · 0 comments · Fixed by #2762
Assignees
Labels
bug Something isn't working Zoe Contract Contracts within Zoe

Comments

@dtribble
Copy link
Member

Describe the bug

Requesting an input quote on a zero amount from the AMM throws an error. It should just return a zero amount.

To Reproduce

This should just get reproduced in a test. Otherwise it requires a specific in-progress token-economy branch.

Expected behavior

It should just return a zero amount.

Platform Environment

any

Additional context

2021-03-30T16:56:52.334Z SwingSet: ls: v19: Logging sent error stack (Error#61)
Error#61: inputValue 0n must be positive

  at meteredConstructor.getInputPrice (packages/zoe/src/contractSupport/bondingCurves.js:44:16)
  at meteredConstructor.getPriceGivenAvailableInput (packages/zoe/src/contracts/multipoolAutoswap/pool.js:106:50)
  at getPriceGivenAvailableInput (packages/zoe/src/contracts/multipoolAutoswap/getCurrentPrice.js:55:28)
  at Alleged: MultipoolAutoswapPublicFacet.getOutputForGivenInput [as getInputPrice] (packages/zoe/src/contracts/multipoolAutoswap/getCurrentPrice.js:130:20)

Screenshots

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Zoe Contract Contracts within Zoe
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants