ripple/ripple-lib — pull request #235 by sublimator (2014-12-20 08:07:06+00:00)
Title: Update Meta.parseBalanceChanges

It was hard to understand the intent of the recent changes, so I could have misunderstood it, but it seemed like it wanted to group balance changes in a way, that the `address` was not an issuer ( gateway).

In any case, I added two test cases. We should at least add these and define the expected balance changes.

The changes:

* Remove Amount.toJSON as it introduces XRP semantics changes.
* In any balance change address and issuer will never be equal.
* Attempt to put `balance_change.issuer` as account that is
issuer in the sense of having a negative balance (or ability to).
The address is the opposite account on the line.

The changes in logic pass all previous tests, but also the new test cases with redeeming and redeeming becoming issuing. I believe we should consider/discuss use cases, before adding these sorts of thing to ripple-lib. Also, If we want to ripple-restify amount representation, it would be good to do so in a planned manner.