Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to SDK 0.45 #12

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f5f35f9
Updated go.mod and go.sum
shawayush Sep 23, 2022
560a57f
Migrated app.go
shawayush Sep 23, 2022
a442307
Updated codec and wasm type in app.go
shawayush Sep 24, 2022
4e62cbf
Migrated IBC to V3
shawayush Sep 24, 2022
86001af
added proposal handler for comsowasm
shawayush Sep 27, 2022
d0ed3f8
fixes
shawayush Oct 7, 2022
9d3e133
minor changes
shawayush Oct 7, 2022
43f77c6
Added Error Handling for main.go
shawayush Oct 10, 2022
f459365
added root, genisis acc
shawayush Oct 10, 2022
1b56e59
Home Directory Fix
shawayush Oct 10, 2022
5cddda8
Added Few functionalities for WASM
shawayush Oct 10, 2022
17f828c
Modified and FIXED Root
shawayush Oct 10, 2022
b9a1f66
Updated Network File for the New Function
shawayush Oct 10, 2022
04983f4
Updated simapp File for the New Function
shawayush Oct 10, 2022
e9a8a3d
added params
shawayush Oct 10, 2022
bc70f98
removed params
shawayush Oct 10, 2022
145b9db
added params
shawayush Oct 10, 2022
afb324d
added params
shawayush Oct 10, 2022
afe1841
Few fixes in paramas coec --> marshaller
shawayush Oct 10, 2022
42e9ffd
few fixes and updates
shawayush Oct 10, 2022
2363e57
updated app
shawayush Oct 10, 2022
57d9469
Refactor the code
unanoc Oct 11, 2022
de4f7b5
Fixed IBC register Router
shawayush Oct 11, 2022
870fcf1
added for wasm, added wasm_config file
shawayush Oct 11, 2022
fda6c32
SDK0.45.6
shawayush Oct 11, 2022
153c271
fix
shawayush Oct 11, 2022
f0a4111
added few functionalities for mmry allocn issue
shawayush Oct 11, 2022
120443d
Refactored Code
shawayush Oct 12, 2022
765cf3d
minor improvements
shawayush Oct 12, 2022
a5ddcf9
Removed Oracle, fixes memory alln issue
shawayush Oct 12, 2022
a920882
added ante.go
shawayush Oct 12, 2022
d06463c
Minor Changes with the code flow
shawayush Oct 12, 2022
c651d15
code flow
shawayush Oct 12, 2022
de285b8
added few functionalities
shawayush Oct 13, 2022
2feebb5
New branch: dev-upgrade
parkkount Oct 13, 2022
8e0fd1e
fix nil pointer errors
parkkount Oct 13, 2022
97e090d
Removed usnued codes
shawayush Oct 13, 2022
48129e2
New SDK 0.45.9 and fixes
shawayush Oct 14, 2022
59772a2
Added ICA
shawayush Oct 17, 2022
2614c89
Minor Fix
shawayush Oct 17, 2022
3104efe
Merge pull request #13 from knstl/sdk0.45.9
shawayush Oct 19, 2022
9b766f6
minor changes
shawayush Oct 19, 2022
a587fd6
Fix IBC and pull request
parkkount Nov 21, 2022
cb59892
Merge pull request #15 from knstl/fix_ibc
shawayush Nov 21, 2022
565fc96
added pruning cmd & preaparation for new patch
shawayush Nov 23, 2022
add00e3
minor changes
shawayush Nov 23, 2022
606ba48
Tag prod version v0.6.1
parkkount Dec 5, 2022
e675abb
Tag prod version v0.6.1
parkkount Dec 5, 2022
051527b
Tag prod version v0.6.1
parkkount Dec 5, 2022
3714868
Quick Fix : Fix UpgradeHandler
parkkount Dec 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 72 additions & 23 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import (
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
"github.com/cosmos/cosmos-sdk/x/authz"
"github.com/cosmos/cosmos-sdk/x/bank"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand All @@ -52,6 +54,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/evidence"
evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cosmos/cosmos-sdk/x/gov"
Expand Down Expand Up @@ -224,6 +227,8 @@ type App struct {
appCodec codec.Codec
interfaceRegistry codectype.InterfaceRegistry
configurator module.Configurator
basicManager module.BasicManager
legacyAmino *codec.LegacyAmino

invCheckPeriod uint

Expand Down Expand Up @@ -286,6 +291,7 @@ func New(
appCodec := encodingConfig.Marshaler
cdc := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry
legacyAmino := encodingConfig.Amino

bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...)
bApp.SetCommitMultiStoreTracer(traceStore)
Expand Down Expand Up @@ -315,6 +321,7 @@ func New(

app := &App{
BaseApp: bApp,
legacyAmino: legacyAmino,
cdc: cdc,
appCodec: appCodec,
interfaceRegistry: interfaceRegistry,
Expand Down Expand Up @@ -385,11 +392,6 @@ func New(
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))

app.GovKeeper = govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
&stakingKeeper, govRouter,
)

// Create Transfer Keepers
app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
Expand All @@ -402,7 +404,7 @@ func New(
app.BankKeeper,
scopedTransferKeeper,
)
transferModule := transfer.NewAppModule(app.TransferKeeper)
//transferModule := transfer.NewAppModule(app.TransferKeeper)

// Create static IBC router, add transfer route, then set and seal it
ibcRouter := porttypes.NewRouter()
Expand All @@ -417,13 +419,15 @@ func New(
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

app.OracleKeeper = *oraclekeeper.NewKeeper(
appCodec,
keys[oracletypes.StoreKey],
keys[oracletypes.MemStoreKey],
app.GetSubspace(oracletypes.ModuleName),
)
oracleModule := oracle.NewAppModule(appCodec, app.OracleKeeper)
// TODO : Get Business logic fromm company

//app.OracleKeeper = *oraclekeeper.NewKeeper(
// appCodec,
// keys[oracletypes.StoreKey],
// keys[oracletypes.MemStoreKey],
// app.GetSubspace(oracletypes.ModuleName),
//)
//oracleModule := oracle.NewAppModule(appCodec, app.OracleKeeper)

// this line is used by starport scaffolding # stargate/app/keeperDefinition
wasmDir := filepath.Join(homePath, "wasm")
Expand Down Expand Up @@ -461,6 +465,11 @@ func New(
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.wasmKeeper, enabledProposals))
}

app.GovKeeper = govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
&stakingKeeper, govRouter,
)

/**** Module Options ****/

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
Expand Down Expand Up @@ -489,9 +498,9 @@ func New(
evidence.NewAppModule(app.EvidenceKeeper),
ibc.NewAppModule(app.IBCKeeper),
params.NewAppModule(app.ParamsKeeper),
transferModule,
//transferModule,
// this line is used by starport scaffolding # stargate/app/appModule
oracleModule,
//oracleModule,
wasm.NewAppModule(appCodec, &app.wasmKeeper, app.StakingKeeper, app.AccoKeeper, app.SimulKepper),
)

Expand All @@ -507,12 +516,39 @@ func New(
slashingtypes.ModuleName,
evidencetypes.ModuleName,
stakingtypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
govtypes.ModuleName,
crisistypes.ModuleName,
genutiltypes.ModuleName,
authz.ModuleName,
feegrant.ModuleName,
paramstypes.ModuleName,
vestingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
wasm.ModuleName,
)
app.mm.SetOrderEndBlockers(
crisistypes.ModuleName,
govtypes.ModuleName,
upgradetypes.ModuleName,
capabilitytypes.ModuleName,
minttypes.ModuleName,
distrtypes.ModuleName,
slashingtypes.ModuleName,
evidencetypes.ModuleName,
stakingtypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
govtypes.ModuleName,
crisistypes.ModuleName,
genutiltypes.ModuleName,
authz.ModuleName,
feegrant.ModuleName,
paramstypes.ModuleName,
vestingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
wasm.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
Expand All @@ -521,27 +557,40 @@ func New(
// so that other modules that want to create or claim capabilities afterwards in InitChain
// can do so safely.
app.mm.SetOrderInitGenesis(
upgradetypes.ModuleName,
capabilitytypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
minttypes.ModuleName,
distrtypes.ModuleName,
stakingtypes.ModuleName,
slashingtypes.ModuleName,
evidencetypes.ModuleName,
stakingtypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
govtypes.ModuleName,
minttypes.ModuleName,
crisistypes.ModuleName,
ibchost.ModuleName,
genutiltypes.ModuleName,
evidencetypes.ModuleName,
authz.ModuleName,
feegrant.ModuleName,
paramstypes.ModuleName,
vestingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
oracletypes.ModuleName,
wasm.ModuleName,
)

app.configurator = module.NewConfigurator(appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
module.BasicManager.RegisterInterfaces(app.basicManager, app.interfaceRegistry)
shawayush marked this conversation as resolved.
Show resolved Hide resolved
app.mm.RegisterInvariants(&app.CrisisKeeper)
app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)

//Before calling RegisterService, you must register all interfaces by calling the `RegisterInterfaces`
//method on module.BasicManager. Each module should call `msgservice.RegisterMsgServiceDesc` inside its
//`RegisterInterfaces` method with the `_Msg_serviceDesc` generated by proto-gen

app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())

app.mm.RegisterServices(app.configurator)

// initialize stores
Expand Down