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

cleanup: remove connectionId logic in msg_server_submit_tx.go #1001

Open
riley-stride opened this issue Nov 30, 2023 · 2 comments
Open

cleanup: remove connectionId logic in msg_server_submit_tx.go #1001

riley-stride opened this issue Nov 30, 2023 · 2 comments
Assignees

Comments

@riley-stride
Copy link
Contributor

riley-stride commented Nov 30, 2023

I believe we can remove the below code block across msg_server_submit_tx.go since it is only used to get the connectionId. Then get the connectoinId from the hz by replacing connectionId with hostZone.connectionId.

owner := types.FormatICAAccountOwner(hostZone.ChainId, types.ICAAccountType_DELEGATION)
portID, err := icatypes.NewControllerPortID(owner)
if err != nil {
return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "%s has no associated portId", owner)
}
connectionId, err := k.GetConnectionId(ctx, portID)
if err != nil {
return errorsmod.Wrapf(sdkerrors.ErrInvalidChainID, "%s has no associated connection", portID)
}
@riley-stride
Copy link
Contributor Author

@sampocs let me know if you agree with this — you pointed this out in #961 and I noticed we use the same pattern in DelegateOnHost and SetWithdrawalAddressOnHost.

@sampocs
Copy link
Collaborator

sampocs commented Nov 30, 2023

yup I agree! I noticed this as well the other day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants