GetPools Use GetPoolsPaginated for RPC queries
(ctx sdk.Context)
| 56 | |
| 57 | // GetPools Use GetPoolsPaginated for RPC queries |
| 58 | func (k Keeper) GetPools(ctx sdk.Context) []*types.Pool { |
| 59 | var poolList []*types.Pool |
| 60 | iterator := k.GetPoolsIterator(ctx) |
| 61 | defer func(iterator sdk.Iterator) { |
| 62 | err := iterator.Close() |
| 63 | if err != nil { |
| 64 | panic(err) |
| 65 | } |
| 66 | }(iterator) |
| 67 | for ; iterator.Valid(); iterator.Next() { |
| 68 | var pool types.Pool |
| 69 | bytesValue := iterator.Value() |
| 70 | k.cdc.MustUnmarshal(bytesValue, &pool) |
| 71 | poolList = append(poolList, &pool) |
| 72 | } |
| 73 | return poolList |
| 74 | } |
| 75 | |
| 76 | func (k Keeper) GetPoolsPaginated(ctx sdk.Context, pagination *query.PageRequest) ([]*types.Pool, *query.PageResponse, error) { |
| 77 | var poolList []*types.Pool |
no test coverage detected