astroband / ruby-stellar-base

The stellar-base library is the lowest-level stellar helper library. It consists of classes to read, write, hash, and sign the xdr structures that are used in stellar-core
Apache License 2.0
21 stars 19 forks source link

`Stellar::Operation.change_trust` accepts nil limits #37

Closed ramontayag closed 6 years ago

ramontayag commented 6 years ago

Useful when there's a wrapper code that always passes this key, regardless of the value being nil.

ramontayag commented 6 years ago

@nullstyle what do you think of this? When working on a high-level convenience method for change_trust, I realized there'd be less logic there about the value of the attribute if Stellar::Operation.change_trust knew how to handle nil limits.

nullstyle commented 6 years ago

@ramontayag I'm hesitant to merge this. Stellar base is a low-level library, and setting a trustline to the max by default is a client-focused, high-level choice. We pick a default for the limit in part because we don't want end users (or other non-technical participants) to burden themselves with the notion of a trustline limit until they need to know it.

Developers, however, should IMO understand that every trustline has a limit and they should probably be deciding directly what appetite for counter party risk their software can tolerate. Having no default on this method is one mechanism for that.

Care to make a counter case? I'm open to be convinced that it provides more help than harm.

ramontayag commented 6 years ago

@nullstyle what you said makes sense. This can be handled in ruby-stellar-sdk instead! Thanks.