Skip to content

Commit

Permalink
remove oracle account address from send blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun committed Oct 22, 2019
1 parent 2f75b51 commit 8fc9ceb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func NewTerraApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
// add keepers
app.accountKeeper = auth.NewAccountKeeper(app.cdc, keys[auth.StoreKey], authSubspace, auth.ProtoBaseAccount)
sendBlackListAddrs := app.ModuleAccountAddrs()
delete(sendBlackListAddrs, oracle.ModuleName)
delete(sendBlackListAddrs, supply.NewModuleAddress(oracle.ModuleName).String())
app.bankKeeper = bank.NewBaseKeeper(app.accountKeeper, bankSubspace, bank.DefaultCodespace, sendBlackListAddrs)
app.supplyKeeper = supply.NewKeeper(app.cdc, keys[supply.StoreKey], app.accountKeeper, app.bankKeeper, maccPerms)
stakingKeeper := staking.NewKeeper(app.cdc, keys[staking.StoreKey], tkeys[staking.TStoreKey],
Expand Down
8 changes: 7 additions & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"
"github.com/terra-project/core/x/oracle"

"github.com/cosmos/cosmos-sdk/codec"

Expand Down Expand Up @@ -52,6 +53,11 @@ func TestBlackListedAddrs(t *testing.T) {
app := NewTerraApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0)

for acc := range maccPerms {
require.True(t, app.bankKeeper.BlacklistedAddr(app.supplyKeeper.GetModuleAddress(acc)))
if acc == oracle.ModuleName {
require.False(t, app.bankKeeper.BlacklistedAddr(app.supplyKeeper.GetModuleAddress(acc)))
} else {
require.True(t, app.bankKeeper.BlacklistedAddr(app.supplyKeeper.GetModuleAddress(acc)))
}

}
}

0 comments on commit 8fc9ceb

Please sign in to comment.