-
Notifications
You must be signed in to change notification settings - Fork 586
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
fix: IdentifiedPacketFee not nullable #746
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketI() { | |
if tc.expPass { | ||
suite.Require().NoError(err) | ||
suite.Require().NotNil(res) | ||
suite.Require().Equal(identifiedPacketFee, res.IncentivizedPacket) | ||
suite.Require().Equal(&identifiedPacketFee, res.IncentivizedPacket) | ||
} else { | ||
suite.Require().Error(err) | ||
} | ||
|
@@ -120,11 +120,11 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPackets() { | |
fee3 := types.NewIdentifiedPacketFee(channeltypes.NewPacketId(ibctesting.FirstChannelID, transfertypes.PortID, 3), fee, refundAcc.String(), []string(nil)) | ||
|
||
expPackets = []*types.IdentifiedPacketFee{} | ||
expPackets = append(expPackets, fee1, fee2, fee3) | ||
expPackets = append(expPackets, &fee1, &fee2, &fee3) | ||
|
||
suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), transfertypes.PortID, ibctesting.FirstChannelID) | ||
for _, p := range expPackets { | ||
suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), p) | ||
suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), *p) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @colin-axner @damiannolan should I just update the queries to no longer return a pointer as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The grpc query server endpoints will always use a pointer req/resp type. I'm not sure there's anyway to not do that, unless there's some gogoproto magic. But all of the grpc queries in ibc-go/sdk return pointer response types afaik so best to keep it consistent. |
||
} | ||
|
||
req = &types.QueryIncentivizedPacketsRequest{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make this a slice of values instead of pointers too and avoid the dereference on L:127
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colin-axner spoke with damian offline and did not change this as I'm using expPackets later to compare with the grpc response. It makes sense to keep it as is.