File tree 6 files changed +16
-21
lines changed 6 files changed +16
-21
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,12 @@ import (
5
5
"encoding/json"
6
6
"fmt"
7
7
8
- "cosmossdk.io/core/store"
9
- "cosmossdk.io/depinject"
10
-
11
8
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
12
9
13
10
modulev1 "cosmossdk.io/api/cosmos/mint/module/v1"
14
11
"cosmossdk.io/core/appmodule"
12
+ "cosmossdk.io/core/store"
13
+ "cosmossdk.io/depinject"
15
14
16
15
"github.com/cosmos/cosmos-sdk/client"
17
16
"github.com/cosmos/cosmos-sdk/codec"
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
10
10
11
11
"github.com/axone-protocol/axoned/v8/x/mint/testutil"
12
12
"github.com/axone-protocol/axoned/v8/x/mint/types"
13
+
13
14
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
14
15
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
15
16
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Original file line number Diff line number Diff line change 1
1
package testutil
2
2
3
3
import (
4
- "github.com/cosmos/cosmos-sdk/testutil/configurator"
5
4
_ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring
6
5
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring
7
6
_ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring
@@ -10,6 +9,8 @@ import (
10
9
_ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring
11
10
_ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring
12
11
_ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring
12
+
13
+ "github.com/cosmos/cosmos-sdk/testutil/configurator"
13
14
)
14
15
15
16
var AppConfig = configurator .NewAppConfig (
Original file line number Diff line number Diff line change @@ -23,5 +23,5 @@ func ValidateGenesis(data GenesisState) error {
23
23
return err
24
24
}
25
25
26
- return data .Minter . Validate ( )
26
+ return ValidateMinter ( data .Minter )
27
27
}
Original file line number Diff line number Diff line change 1
1
package types
2
2
3
- // MinterKey is the key to use for the keeper store.
3
+ import "cosmossdk.io/collections"
4
+
4
5
var (
5
- MinterKey = []byte {0x00 }
6
- ParamsKey = []byte {0x01 }
6
+ // MinterKey is the key to use for the keeper store.
7
+ MinterKey = collections .NewPrefix (0 )
8
+ ParamsKey = collections .NewPrefix (1 )
7
9
)
8
10
9
11
const (
@@ -12,12 +14,4 @@ const (
12
14
13
15
// StoreKey is the default store key for mint.
14
16
StoreKey = ModuleName
15
-
16
- // QuerierRoute is the querier route for the minting store.
17
- QuerierRoute = StoreKey
18
-
19
- // Query endpoints supported by the minting querier.
20
- QueryParameters = "parameters"
21
- QueryInflation = "inflation"
22
- QueryAnnualProvisions = "annual_provisions"
23
17
)
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ func NewMinterWithInflationCoef(
37
37
}
38
38
minter := NewMinter (inflationRate , inflationRate .MulInt (totalSupply ))
39
39
40
- return minter , minter . Validate ( )
40
+ return minter , ValidateMinter ( minter )
41
41
}
42
42
43
43
// DefaultInitialMinter returns a default initial Minter object for a new chain
@@ -48,11 +48,11 @@ func DefaultInitialMinter() Minter {
48
48
)
49
49
}
50
50
51
- // Validate validates the mint parameters .
52
- func ( m Minter ) Validate ( ) error {
53
- if m .Inflation .IsNegative () {
51
+ // ValidateMinter does a basic validation on minter .
52
+ func ValidateMinter ( minter Minter ) error {
53
+ if minter .Inflation .IsNegative () {
54
54
return fmt .Errorf ("mint parameter Inflation should be positive, is %s" ,
55
- m .Inflation .String ())
55
+ minter .Inflation .String ())
56
56
}
57
57
return nil
58
58
}
You can’t perform that action at this time.
0 commit comments