MCPcopy Create free account
hub / github.com/Sifchain/sifnode / TestKeeper_NewQueryServer

Function TestKeeper_NewQueryServer

x/margin/keeper/grpc_query_test.go:13–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestKeeper_NewQueryServer(t *testing.T) {
14 ctx, app := test.CreateTestAppMargin(false)
15
16 addMTPKey(t, ctx, app, app.MarginKeeper, "ceth", "rowan", "sif1syavy2npfyt9tcncdtsdzf7kny9lh777yqc2nd", margintypes.Position_LONG, 1, sdk.NewDec(20))
17
18 queryServer := keeper.NewQueryServer(app.MarginKeeper)
19
20 res, err := queryServer.GetPositionsForAddress(sdk.WrapSDKContext(ctx), &margintypes.PositionsForAddressRequest{
21 Address: "sif1syavy2npfyt9tcncdtsdzf7kny9lh777yqc2nd",
22 Pagination: nil,
23 })
24 require.NoError(t, err)
25 require.Len(t, res.Mtps, 1)
26}

Callers

nothing calls this directly

Calls 4

CreateTestAppMarginFunction · 0.92
NewQueryServerFunction · 0.92
addMTPKeyFunction · 0.85

Tested by

no test coverage detected