You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The servicefee.FeeExpressions type is an alias of a map[string]float64 which means that it inherits the built in map's behavior which is especially apparent when iterating over the expressions to calculate a fee.
The iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next....
The effect is such that if you specify the fees as below, the service fee for the amount 10,000 for example can be either 500.0 OR 5.0 - we need this to be more deterministic, and have the rules evaluated in the order they are specified
@Horac3 i have updated the description. It would also be interesting to look into mutation testing for this, but that doesn't have to be part of the PR for this issue.
The
servicefee.FeeExpressions
type is an alias of amap[string]float64
which means that it inherits the built in map's behavior which is especially apparent when iterating over the expressions to calculate a fee.From: https://go.dev/ref/spec#For_range
The effect is such that if you specify the fees as below, the service fee for the amount 10,000 for example can be either 500.0 OR 5.0 - we need this to be more deterministic, and have the rules evaluated in the order they are specified
Try on Go Play Ground: https://go.dev/play/p/4FiMV6jd6cI
The text was updated successfully, but these errors were encountered: