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

test(perp): MsgServer tests #692

Merged
merged 9 commits into from
Jul 11, 2022
Merged

test(perp): MsgServer tests #692

merged 9 commits into from
Jul 11, 2022

Conversation

NibiruHeisenberg
Copy link
Contributor

  • add basic error checking coverage for the following perp msg server methods
    • OpenPosition
    • ClosePosition
    • Liquidate

@NibiruHeisenberg NibiruHeisenberg requested a review from a team as a code owner July 9, 2022 18:13
@NibiruHeisenberg NibiruHeisenberg changed the title test(perp): MsgServer tests test(perp): MsgServer tests Jul 9, 2022
@NibiruHeisenberg NibiruHeisenberg self-assigned this Jul 9, 2022
@@ -65,12 +64,12 @@ func (m msgServer) ClosePosition(goCtx context.Context, position *types.MsgClose
ctx := sdk.UnwrapSDKContext(goCtx)
addr, err := sdk.AccAddressFromBech32(position.Sender)
if err != nil {
panic(err)
return nil, err
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think panic in this cases is better as ValidateBasic should have covered these cases, so an error here is totally unexpected.

Copy link
Collaborator

@testinginprod testinginprod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit but LGTM.

@NibiruHeisenberg NibiruHeisenberg merged commit 13e1857 into master Jul 11, 2022
@NibiruHeisenberg NibiruHeisenberg deleted the test/perp/msg-server branch July 11, 2022 16:46
@NibiruHeisenberg NibiruHeisenberg restored the test/perp/msg-server branch July 12, 2022 20:24
@NibiruHeisenberg NibiruHeisenberg deleted the test/perp/msg-server branch July 12, 2022 20:35
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

Successfully merging this pull request may close these issues.

2 participants