Skip to content

Commit

Permalink
add query
Browse files Browse the repository at this point in the history
  • Loading branch information
dev10 committed Aug 22, 2019
1 parent 96cd8c2 commit a92986e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
16 changes: 14 additions & 2 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type fantomAssetManagement struct {
tkeyStaking *sdk.TransientStoreKey
keyDistr *sdk.KVStoreKey
tkeyDistr *sdk.TransientStoreKey
keyNS *sdk.KVStoreKey
keyAM *sdk.KVStoreKey
keyParams *sdk.KVStoreKey
tkeyParams *sdk.TransientStoreKey
keySlashing *sdk.KVStoreKey
Expand All @@ -82,7 +82,7 @@ type fantomAssetManagement struct {
distrKeeper distr.Keeper
supplyKeeper supply.Keeper
paramsKeeper params.Keeper
nsKeeper assetmanagement.Keeper
amKeeper assetmanagement.Keeper

// Module Manager
mm *module.Manager
Expand All @@ -99,6 +99,18 @@ func NewFantomAssetManagementApp(logger log.Logger, db dbm.DB) *fantomAssetManag
var app = &fantomAssetManagement{
BaseApp: bApp,
cdc: cdc,

keyMain: sdk.NewKVStoreKey(bam.MainStoreKey),
keyAccount: sdk.NewKVStoreKey(auth.StoreKey),
keySupply: sdk.NewKVStoreKey(supply.StoreKey),
keyStaking: sdk.NewKVStoreKey(staking.StoreKey),
tkeyStaking: sdk.NewTransientStoreKey(staking.TStoreKey),
keyDistr: sdk.NewKVStoreKey(distr.StoreKey),
tkeyDistr: sdk.NewTransientStoreKey(distr.TStoreKey),
keyAM: sdk.NewKVStoreKey(assetmanagement.StoreKey),
keyParams: sdk.NewKVStoreKey(params.StoreKey),
tkeyParams: sdk.NewTransientStoreKey(params.TStoreKey),
keySlashing: sdk.NewKVStoreKey(slashing.StoreKey),
}

return app
Expand Down
9 changes: 9 additions & 0 deletions x/assetmanagement/alias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package assetmanagement

import "github.com/dev10/fantom-asset-management/x/assetmanagement/types"

const (
ModuleName = types.ModuleName
RouterKey = types.RouterKey
StoreKey = types.StoreKey
)
15 changes: 15 additions & 0 deletions x/assetmanagement/types/querier.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package types

import "strings"

// QueryResultTokens is a payload for a tokens query
type QueryResultTokens []Token

// String implements fmt.Stringer
func (r QueryResultTokens) String() string {
array := make([]string, len(r))
for _, t := range r {
array = append(array, t.String())
}
return strings.Join(array, "\n")
}

0 comments on commit a92986e

Please sign in to comment.