radixdlt/radixdlt-java

Missing "to address" in TokenTransfer when sender==receiver

Closed this issue · 1 comments

nadam commented

I'm not sure why anyone would want to send rads to themselves, but I tried it as a test and then TokenTransfer.getTo() returns null. Should return same address as TokenTransfer.getFrom(). Probably easy to fix in TokenTransferTranslator.fromAtom().

As a work-around I currently check if amount is zero.

nadam commented

I tried to fix it, but it wasn't obvious to me how to create a unit test for it.