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

feat: apply a feature that preventing sending coins to inactive contract #36

Merged
merged 4 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ Ref: https://keepachangelog.com/en/1.0.0/
## [Unreleased]

### Features
* (x/upgrade) [\#33] (https://github.com/line/lbm/pull/33) To smoothen the update to the latest stable release, the SDK includes vesion map for managing migrations between SDK versions.
* (x/upgrade) [\#33](https://github.com/line/lbm/pull/33) To smoothen the update to the latest stable release, the SDK includes version map for managing migrations between SDK versions.
zemyblue marked this conversation as resolved.
Show resolved Hide resolved
* (x/consortium) [\#34](https://github.com/line/lbm/pull/34) add feegrant, consortium and stakingplus module
* (x/bank) [\#36](https://github.com/line/lbm/pull/36) apply a feature that preventing sending coins to inactive contract (related to [lbm-sdk #400](https://github.com/line/lbm-sdk/pull/400))

### Improvements
* (slashing) [\#31] (https://github.com/line/lbm/pull/31) Apply VoterSetCounter
Expand Down
18 changes: 11 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ import (
authtypes "github.com/line/lbm-sdk/x/auth/types"
"github.com/line/lbm-sdk/x/auth/vesting"
"github.com/line/lbm-sdk/x/bank"
bankkeeper "github.com/line/lbm-sdk/x/bank/keeper"
banktypes "github.com/line/lbm-sdk/x/bank/types"
"github.com/line/lbm-sdk/x/bankplus"
bankpluskeeper "github.com/line/lbm-sdk/x/bankplus/keeper"
"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"
Expand Down Expand Up @@ -129,8 +130,8 @@ var (
distrclient.ProposalHandler,
upgradeclient.ProposalHandler,
upgradeclient.CancelProposalHandler,
)...
),
)...,
),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
Expand Down Expand Up @@ -182,7 +183,7 @@ type LinkApp struct { // nolint: golint

// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
BankKeeper bankpluskeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
Expand Down Expand Up @@ -278,7 +279,7 @@ func NewLinkApp(
app.AccountKeeper = authkeeper.NewAccountKeeper(
appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms,
)
app.BankKeeper = bankkeeper.NewBaseKeeper(
app.BankKeeper = bankpluskeeper.NewBaseKeeper(
appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.BlockedAddrs(),
)
stakingKeeper := stakingkeeper.NewKeeper(
Expand Down Expand Up @@ -402,7 +403,7 @@ func NewLinkApp(
),
auth.NewAppModule(appCodec, app.AccountKeeper, nil),
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
bankplus.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
capability.NewAppModule(appCodec, *app.CapabilityKeeper),
crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants),
feegrant.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
Expand Down Expand Up @@ -467,7 +468,7 @@ func NewLinkApp(
// transactions
app.sm = module.NewSimulationManager(
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts),
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
bankplus.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
capability.NewAppModule(appCodec, *app.CapabilityKeeper),
feegrant.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
Expand Down Expand Up @@ -519,6 +520,9 @@ func NewLinkApp(
if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil {
panic(err)
}

// Initialize the keeper of bankkeeper
app.BankKeeper.InitializeBankPlus(ctx)
}
app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedTransferKeeper = scopedTransferKeeper
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.15

require (
github.com/gorilla/mux v1.8.0
github.com/line/lbm-sdk v1.0.0-init.1.0.20211223043226-0e7b3cfe190c
github.com/line/lbm-sdk v1.0.0-init.1.0.20220110032243-cb1ad8015920
github.com/line/ostracon v1.0.2
github.com/line/tm-db/v2 v2.0.0-init.1.0.20211202001648-945e88fd2edf
github.com/prometheus/client_golang v1.11.0
Expand All @@ -13,7 +13,6 @@ require (
github.com/spf13/cobra v1.3.0
github.com/spf13/viper v1.10.1
github.com/stretchr/testify v1.7.0
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
)

replace (
Expand Down
5 changes: 4 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,11 @@ 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.20211019080724-001e2272a25d h1:mXlamMU/uWGrW+7BJCUroZYo8mZ2q2zYS88dmsS0Ous=
github.com/line/iavl/v2 v2.0.0-init.1.0.20211019080724-001e2272a25d/go.mod h1:0Xz+0i1nlB9lrjUDEwpDRhcmjfEAkOjd20dRb40FBso=
github.com/line/lbm-sdk v1.0.0-init.1.0.20211223043226-0e7b3cfe190c h1:Uq9bDv/Fq5t+NXQpGzzvWpFH5rqHl20xvvacP36Vf7M=
github.com/line/lbm-sdk v0.44.0-rc0 h1:GJFetI975al17g1xiLclE2J7zQenhkS3aROpmlPIQ+g=
github.com/line/lbm-sdk v0.44.0-rc0/go.mod h1:LR7hb3yC8JT5mnzCIiHw19ukfNwL5E5EMsGYc0G7F58=
github.com/line/lbm-sdk v1.0.0-init.1.0.20211223043226-0e7b3cfe190c/go.mod h1:LR7hb3yC8JT5mnzCIiHw19ukfNwL5E5EMsGYc0G7F58=
github.com/line/lbm-sdk v1.0.0-init.1.0.20220110032243-cb1ad8015920 h1:aF4DdCBEd0gex1LGQPHHVYA6Oppf2aq5gYanuiZ+Fg8=
github.com/line/lbm-sdk v1.0.0-init.1.0.20220110032243-cb1ad8015920/go.mod h1:LR7hb3yC8JT5mnzCIiHw19ukfNwL5E5EMsGYc0G7F58=
github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d/go.mod h1:ttnbq+yQJMQ9a2MT5SEisOoa/+pOgh2KenTiK/rVdiw=
github.com/line/ostracon v1.0.2 h1:sbZtNrLYFKDP74tXYgMVkrzKJKk2Sqn1Oczl1+f7sgI=
github.com/line/ostracon v1.0.2/go.mod h1:elTiUFLvBz6Yaze+ZZLlbUnhqKWLJ7cMy/P9rSabafQ=
Expand Down