Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ErrDuplicateEntry to ErrInvalidAuthorization & change error formatting #2988

Merged
merged 8 commits into from
Jan 9, 2023
2 changes: 1 addition & 1 deletion modules/apps/transfer/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ var (
ErrSendDisabled = sdkerrors.Register(ModuleName, 7, "fungible token transfers from this chain are disabled")
ErrReceiveDisabled = sdkerrors.Register(ModuleName, 8, "fungible token transfers to this chain are disabled")
ErrMaxTransferChannels = sdkerrors.Register(ModuleName, 9, "max transfer channels")
ErrDuplicateEntry = sdkerrors.Register(ModuleName, 10, "duplicated entry")
ErrInvalidAuthorization = sdkerrors.Register(ModuleName, 10, "invalid transfer authorization")
)
2 changes: 1 addition & 1 deletion modules/apps/transfer/types/transfer_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (a TransferAuthorization) ValidateBasic() error {
found := make(map[string]bool, 0)
for i := 0; i < len(allocation.AllowedAddresses); i++ {
if found[allocation.AllowedAddresses[i]] {
return ErrDuplicateEntry
return sdkerrors.Wrapf(ErrInvalidAuthorization, "duplicate entry in allow list %s")
}
found[allocation.AllowedAddresses[i]] = true
}
Expand Down