Skip to content

Commit

Permalink
apply lbm-sdk v0.46.0-rc1 (#62)
Browse files Browse the repository at this point in the history
* apply lbm-sdk v0.46.0-rc1
 - added x/foundation module
 - add index field in to TxResponse

* doc: add the changes of this pr.

Signed-off-by: zemyblue <[email protected]>

* chore: remove unnecessary code.

Signed-off-by: zemyblue <[email protected]>
  • Loading branch information
zemyblue authored May 23, 2022
1 parent cff245f commit 812a069
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 26 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

This version based on lbm-sdk v0.46.0

### Features
* (cosmos-sdk) [\#56](https://github.com/line/lbm/pull/56) bump up cosmos-sdk v0.45.1
* (cosmos-sdk) [\#56](https://github.com/line/lbm/pull/56) bump up cosmos-sdk v0.45.1
* (x/foundation) [\#62](https://github.com/line/lbm/pull/62) add `x/foundation` module of lbm-sdk

### Improvements

Expand Down
39 changes: 21 additions & 18 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ import (
"github.com/line/lbm-sdk/x/capability"
capabilitykeeper "github.com/line/lbm-sdk/x/capability/keeper"
capabilitytypes "github.com/line/lbm-sdk/x/capability/types"
"github.com/line/lbm-sdk/x/consortium"
consortiumclient "github.com/line/lbm-sdk/x/consortium/client"
consortiumkeeper "github.com/line/lbm-sdk/x/consortium/keeper"
consortiummodule "github.com/line/lbm-sdk/x/consortium/module"
"github.com/line/lbm-sdk/x/crisis"
crisiskeeper "github.com/line/lbm-sdk/x/crisis/keeper"
crisistypes "github.com/line/lbm-sdk/x/crisis/types"
Expand All @@ -66,6 +62,10 @@ import (
"github.com/line/lbm-sdk/x/feegrant"
feegrantkeeper "github.com/line/lbm-sdk/x/feegrant/keeper"
feegrantmodule "github.com/line/lbm-sdk/x/feegrant/module"
"github.com/line/lbm-sdk/x/foundation"
foundationclient "github.com/line/lbm-sdk/x/foundation/client"
foundationkeeper "github.com/line/lbm-sdk/x/foundation/keeper"
foundationmodule "github.com/line/lbm-sdk/x/foundation/module"
"github.com/line/lbm-sdk/x/genutil"
genutiltypes "github.com/line/lbm-sdk/x/genutil/types"
"github.com/line/lbm-sdk/x/gov"
Expand Down Expand Up @@ -95,7 +95,7 @@ import (
"github.com/line/lbm-sdk/x/staking"
stakingkeeper "github.com/line/lbm-sdk/x/staking/keeper"
stakingtypes "github.com/line/lbm-sdk/x/staking/types"
"github.com/line/lbm-sdk/x/stakingplus"
stakingplusmodule "github.com/line/lbm-sdk/x/stakingplus/module"
"github.com/line/lbm-sdk/x/token"
"github.com/line/lbm-sdk/x/token/class"
classkeeper "github.com/line/lbm-sdk/x/token/class/keeper"
Expand Down Expand Up @@ -128,15 +128,15 @@ var (
genutil.AppModuleBasic{},
bank.AppModuleBasic{},
capability.AppModuleBasic{},
staking.AppModuleBasic{},
stakingplusmodule.AppModuleBasic{},
mint.AppModuleBasic{},
distr.AppModuleBasic{},
consortiummodule.AppModuleBasic{},
foundationmodule.AppModuleBasic{},
gov.NewAppModuleBasic(
append(
wasmclient.ProposalHandlers,
consortiumclient.UpdateConsortiumParamsProposalHandler,
consortiumclient.UpdateValidatorAuthsProposalHandler,
foundationclient.UpdateFoundationParamsProposalHandler,
foundationclient.UpdateValidatorAuthsProposalHandler,
paramsclient.ProposalHandler,
distrclient.ProposalHandler,
upgradeclient.ProposalHandler,
Expand All @@ -163,6 +163,8 @@ var (
maccPerms = map[string][]string{
authtypes.FeeCollectorName: nil,
distrtypes.ModuleName: nil,
foundation.TreasuryName: nil,
foundation.AdministratorName: nil,
minttypes.ModuleName: {authtypes.Minter},
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
Expand Down Expand Up @@ -204,7 +206,7 @@ type LinkApp struct { // nolint: golint
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
ConsortiumKeeper consortiumkeeper.Keeper
FoundationKeeper foundationkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper crisiskeeper.Keeper
UpgradeKeeper upgradekeeper.Keeper
Expand Down Expand Up @@ -268,7 +270,7 @@ func NewLinkApp(
ibctransfertypes.StoreKey,
capabilitytypes.StoreKey,
feegrant.StoreKey,
consortium.StoreKey,
foundation.StoreKey,
class.StoreKey,
token.StoreKey,
wasm.StoreKey,
Expand Down Expand Up @@ -329,7 +331,8 @@ func NewLinkApp(
)
app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper)
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp)
app.ConsortiumKeeper = consortiumkeeper.NewKeeper(appCodec, keys[consortium.StoreKey], stakingKeeper)
foundationConfig := foundation.DefaultConfig()
app.FoundationKeeper = foundationkeeper.NewKeeper(appCodec, keys[foundation.StoreKey], app.BaseApp.MsgServiceRouter(), app.AccountKeeper, app.BankKeeper, stakingKeeper, authtypes.FeeCollectorName, foundationConfig)

classKeeper := classkeeper.NewKeeper(appCodec, keys[class.StoreKey])
app.TokenKeeper = tokenkeeper.NewKeeper(appCodec, keys[token.StoreKey], app.AccountKeeper, classKeeper)
Expand Down Expand Up @@ -407,7 +410,7 @@ func NewLinkApp(
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(consortium.RouterKey, consortiumkeeper.NewProposalHandler(app.ConsortiumKeeper)).
AddRoute(foundation.RouterKey, foundationkeeper.NewProposalHandler(app.FoundationKeeper)).
AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasm.EnableAllProposals))

govKeeper := govkeeper.NewKeeper(
Expand Down Expand Up @@ -445,12 +448,12 @@ func NewLinkApp(
capability.NewAppModule(appCodec, *app.CapabilityKeeper),
crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants),
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
consortiummodule.NewAppModule(appCodec, app.ConsortiumKeeper, app.StakingKeeper),
foundationmodule.NewAppModule(appCodec, app.FoundationKeeper, app.StakingKeeper),
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
stakingplus.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.ConsortiumKeeper),
stakingplusmodule.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.FoundationKeeper),
upgrade.NewAppModule(app.UpgradeKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
Expand All @@ -469,6 +472,7 @@ func NewLinkApp(
upgradetypes.ModuleName,
capabilitytypes.ModuleName,
minttypes.ModuleName,
foundation.ModuleName,
distrtypes.ModuleName,
slashingtypes.ModuleName,
evidencetypes.ModuleName,
Expand All @@ -484,7 +488,6 @@ func NewLinkApp(
vestingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
consortium.ModuleName,
token.ModuleName,
wasm.ModuleName,
)
Expand All @@ -507,7 +510,7 @@ func NewLinkApp(
vestingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
consortium.ModuleName,
foundation.ModuleName,
token.ModuleName,
wasm.ModuleName,
)
Expand Down Expand Up @@ -540,7 +543,7 @@ func NewLinkApp(
vestingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
consortium.ModuleName,
foundation.ModuleName,
token.ModuleName,
// wasm after ibc transfer
wasm.ModuleName,
Expand Down
5 changes: 4 additions & 1 deletion cli_test/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import (
wasmcli "github.com/line/lbm-sdk/x/wasm/client/cli"

wasmtypes "github.com/line/lbm-sdk/x/wasm/types"
ostcmd "github.com/line/ostracon/cmd/ostracon/commands"
ostcfg "github.com/line/ostracon/config"
ostflags "github.com/line/ostracon/libs/cli/flags"
"github.com/line/ostracon/libs/log"
Expand Down Expand Up @@ -141,6 +142,8 @@ func init() {
server.ShowValidatorCmd(),
server.ShowAddressCmd(),
server.VersionCmd(),
ostcmd.ResetAllCmd,
ostcmd.ResetStateCmd,
)
}

Expand Down Expand Up @@ -352,7 +355,7 @@ func getCliCtx(f *Fixtures) client.Context {

// UnsafeResetAll is lbm unsafe-reset-all
func (f *Fixtures) UnsafeResetAll(flags ...string) {
cmd := server.UnsafeResetAllCmd()
cmd := ostcmd.ResetAllCmd
_, err := testcli.ExecTestCLICmd(getCliCtx(f), cmd, addFlags("", flags...))
require.NoError(f.T, err)

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ go 1.15
require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/gorilla/mux v1.8.0
github.com/line/lbm-sdk v0.46.0-rc0
github.com/line/lbm-sdk v0.46.0-rc1
github.com/line/ostracon v1.0.5
github.com/line/tm-db/v2 v2.0.0-init.1.0.20220121012851-61d2bc1d9486
github.com/prometheus/client_golang v1.12.1
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.4.1
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.11.0
github.com/stretchr/testify v1.7.1
Expand Down
14 changes: 10 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVB
github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo=
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
Expand Down Expand Up @@ -687,8 +689,9 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand All @@ -711,8 +714,8 @@ github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55 h1:cXVtMiJkvQ4kn0px
github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55/go.mod h1:DHRJroSL7NaRkpvocRx3OtRsleXVsYSxBI9SfHFlTQ0=
github.com/line/iavl/v2 v2.0.0-init.1.0.20220215225951-cb11c91d8857 h1:8kWqbLNeb37357e4U/7uLMVCRF3K9bxwTGb6JmRUKpI=
github.com/line/iavl/v2 v2.0.0-init.1.0.20220215225951-cb11c91d8857/go.mod h1:uK2CYRdukSVRGhc5Q8zoDUnm/zAbfnZATbFXrfCrQKA=
github.com/line/lbm-sdk v0.46.0-rc0 h1:UQdjT/Te5uu35sINrKIb0+A/05hXq3Gg+0iCg9PMwFU=
github.com/line/lbm-sdk v0.46.0-rc0/go.mod h1:zbPQ4QMG9BYwm+38ntDzTkbHQb2lASowSPAYsJSFAqg=
github.com/line/lbm-sdk v0.46.0-rc1 h1:au29/L4aGQIewcYdV64AXfC58HwSrsxxn/m4LvOh5Hk=
github.com/line/lbm-sdk v0.46.0-rc1/go.mod h1:RTjbLeeSxSoNYLG9v8s5f9iOOQqZMxoTv3QWJdnZpdo=
github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d/go.mod h1:ttnbq+yQJMQ9a2MT5SEisOoa/+pOgh2KenTiK/rVdiw=
github.com/line/ostracon v1.0.5 h1:fHTbmFbpF2zu8yqggntoxMYnpTQknaimgw2pWDOVESg=
github.com/line/ostracon v1.0.5/go.mod h1:Xeu8AXIcWUmQ80AQMgM+m5PGiVHaIVW8wa66KgF46ZU=
Expand Down Expand Up @@ -955,6 +958,8 @@ github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRr
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U=
github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
Expand Down Expand Up @@ -997,8 +1002,9 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B
github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA=
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
Expand Down

0 comments on commit 812a069

Please sign in to comment.