-
Notifications
You must be signed in to change notification settings - Fork 639
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
Confusion regarding next sequence recv #1783
Comments
Thanks for opening the issue @adizere! I agree with the suggested fix of using null as a return on unordered channels. In golang, I believe null would be 0. Might be best to just change the return value in the gRPC for now |
Then the solution for now is to modify channel, found := q.GetChannel(ctx, req.PortId, req.ChannelId)
if !found {
return nil, status.Error(
codes.NotFound,
sdkerrors.Wrapf(types.ErrChannelNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(),
)
} and then we declare and initialize to 0 the var sequence uint64 = 0 // return 0 for unordered channels
if channel.Ordering == types.ORDERED {
sequence, found = q.GetNextSequenceRecv(ctx, req.PortId, req.ChannelId)
if !found {
return nil, status.Error(
codes.NotFound,
sdkerrors.Wrapf(types.ErrSequenceReceiveNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(),
)
}
} |
Summary
A relayer operator reported this confusion:
The answer, thanks for @crodriguezvega, was:
Expected Behaviour
No confusion regarding this undocumented feature.
Possible suggestion for a fix:
Version
Steps to Reproduce
For Admin Use
The text was updated successfully, but these errors were encountered: