ibc-go
ibc-go copied to clipboard
Be consistent with receiver type on method definitions
Reference comment: https://github.com/cosmos/ibc-go/pull/6103#discussion_r1559121898
We should try and not mix and mash pointer-value receivers on methods and instead consistently use one or the other. For types that need mutations and already have a method that receives value as a pointer, rest of methods can be amended to change from a value receiver to a pointer.
For small types that don't have a pointer receiver currently and also aren't costly to pass around as args, we can stick with value receivers.
For Admin Use
- [ ] Not duplicate issue
- [ ] Appropriate labels applied
- [ ] Appropriate contributors tagged/assigned
My vote: make all functions on keepers a reference. For state modifications it's not technically required, since different struct instances will be making changes to the same underlying store, but whenever we want to associate other forms of state (member fields, references etc. ) things become a headache.