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

Bug: Stripping issuer from Amount<Issued<T>> does not preserve displayTokenSize #2674

Closed
dazraf opened this Issue Feb 28, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@dazraf
Copy link
Contributor

commented Feb 28, 2018

This was found on release version 2.0.0.

class Test {
  @Test
  fun `removing the issuer from an amount should preserve the displayTokenSize`() {
    val amount = Amount(1000, BigDecimal.TEN, "Widgets")
    val partyAndRef = DUMMY_BANK_A.ref(0x01)
    val issued = Issued(partyAndRef, amount.token)
    val issuedAmount = Amount(amount.quantity, amount.displayTokenSize, issued)
    val withoutIssuer = issuedAmount.withoutIssuer()
    // ^^^ this is the problem ^^^
    // in removing the issuer, the implementation ignores the display token size
    // and parses the token which defaults to 2dp
    assertEquals(amount, withoutIssuer)
  }
}
@mikehearn

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2018

@joeldudleyr3

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2018

Thanks for reporting this. Fixed by #3019.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.