Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 committed Mar 25, 2024
1 parent 6d41b45 commit c730ee8
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 305 deletions.
27 changes: 21 additions & 6 deletions app/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package app
import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
"google.golang.org/protobuf/types/known/durationpb"

runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1"
Expand Down Expand Up @@ -73,6 +74,11 @@ import (
_ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"

collectionmodulev1 "github.com/Finschia/finschia-sdk/api/lbm/collection/module/v1"
foundationmodulev1 "github.com/Finschia/finschia-sdk/api/lbm/foundation/module/v1"
"github.com/Finschia/finschia-sdk/x/collection"
Expand All @@ -81,16 +87,25 @@ import (
_ "github.com/Finschia/finschia-sdk/x/foundation/module" // import for side-effects
)

const (
Bech32MainPrefix = "link"
Bech32ValPrefix = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixOperator
Bech32ConsPrefix = Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixConsensus
)

var (
// module account permissions
moduleAccPerms = []*authmodulev1.ModuleAccountPermission{
{Account: authtypes.FeeCollectorName},
{Account: distrtypes.ModuleName},
{Account: nft.ModuleName},
{Account: minttypes.ModuleName, Permissions: []string{authtypes.Minter}},
{Account: stakingtypes.BondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}},
{Account: stakingtypes.NotBondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}},
{Account: govtypes.ModuleName, Permissions: []string{authtypes.Burner}},
{Account: nft.ModuleName},
{Account: wasmtypes.ModuleName, Permissions: []string{authtypes.Burner}},
{Account: ibctransfertypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}},
{Account: icatypes.ModuleName},
{Account: collection.ModuleName},
{Account: foundation.ModuleName},
{Account: foundation.TreasuryName},
Expand All @@ -107,8 +122,8 @@ var (
collection.ModuleName,
foundation.ModuleName,
foundation.TreasuryName,
govtypes.ModuleName,
// We allow the following module accounts to receive funds:
// govtypes.ModuleName
}

// application configuration (used by depinject)
Expand All @@ -117,7 +132,7 @@ var (
{
Name: runtime.ModuleName,
Config: appconfig.WrapAny(&runtimev1alpha1.Module{
AppName: "SimApp",
AppName: "FnsaApp",
// NOTE: upgrade module is required to be prioritized
PreBlockers: []string{
upgradetypes.ModuleName,
Expand Down Expand Up @@ -184,7 +199,7 @@ var (
{
Name: authtypes.ModuleName,
Config: appconfig.WrapAny(&authmodulev1.Module{
Bech32Prefix: "link",
Bech32Prefix: Bech32MainPrefix,
ModuleAccountPermissions: moduleAccPerms,
// By default modules authority is the governance module. This is configurable with the following:
// Authority: "group", // A custom module authority can be set using a module name
Expand All @@ -206,8 +221,8 @@ var (
Config: appconfig.WrapAny(&stakingmodulev1.Module{
// NOTE: specifying a prefix is only necessary when using bech32 addresses
// If not specfied, the auth Bech32Prefix appended with "valoper" and "valcons" is used by default
Bech32PrefixValidator: "linkvaloper",
Bech32PrefixConsensus: "linkvalcons",
Bech32PrefixValidator: Bech32ValPrefix,
Bech32PrefixConsensus: Bech32ConsPrefix,
}),
},
{
Expand Down
23 changes: 23 additions & 0 deletions app/params/weights.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package params

// Default simulation operation weights for messages and gov proposals
const (
DefaultWeightMsgStoreCode int = 50
DefaultWeightMsgInstantiateContract int = 100
DefaultWeightMsgExecuteContract int = 100
DefaultWeightMsgUpdateAdmin int = 25
DefaultWeightMsgClearAdmin int = 10
DefaultWeightMsgMigrateContract int = 50

DefaultWeightStoreCodeProposal int = 5
DefaultWeightInstantiateContractProposal int = 5
DefaultWeightUpdateAdminProposal int = 5
DefaultWeightExecuteContractProposal int = 5
DefaultWeightClearAdminProposal int = 5
DefaultWeightMigrateContractProposal int = 5
DefaultWeightSudoContractProposal int = 5
DefaultWeightPinCodesProposal int = 5
DefaultWeightUnpinCodesProposal int = 5
DefaultWeightUpdateInstantiateConfigProposal int = 5
DefaultWeightStoreAndInstantiateContractProposal int = 5
)
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ require (
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/CosmWasm/wasmd v0.50.0 // indirect
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/aws/aws-sdk-go v1.44.224 // indirect
Expand All @@ -78,13 +79,14 @@ require (
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20231101195458-481da04154d6 // indirect
github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.9.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/iavl v1.0.0 // indirect
github.com/cosmos/ibc-go/v8 v8.0.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/creachadair/atomicfile v0.3.1 // indirect
github.com/creachadair/tomledit v0.0.24 // indirect
Expand Down Expand Up @@ -119,7 +121,7 @@ require (
github.com/google/uuid v1.5.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
Expand Down Expand Up @@ -208,7 +210,7 @@ require (
gotest.tools/v3 v3.5.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
pgregory.net/rapid v1.1.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace (
Expand Down
Loading

0 comments on commit c730ee8

Please sign in to comment.