Skip to content

Commit

Permalink
Allow list. Token factory changes (#1844)
Browse files Browse the repository at this point in the history
* untested draft

* go.sum updated

* formatting

* more testing

* grcp tests

* convert 0x addresses to sei

* remove dups from the list

* fix lint comment

* goimported

* update denom support

* - limit allow list size
- update denom checks

* more tests

* update denom tests

* add negative tests for gRPC

* update test formatting

* add tests for new command

* Update denom message tests

* Add proto comments

* return error if address is not associated

* update command to accept denom instead of subdenom

* update proto form subdenom to denom

* point back to custom sei-cosmos

* bump sei-cosmos version
  • Loading branch information
dssei committed Sep 20, 2024
1 parent fa43819 commit cfd8cec
Show file tree
Hide file tree
Showing 26 changed files with 24,230 additions and 25,201 deletions.
6 changes: 6 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,13 +532,19 @@ func New(
).SetHooks(epochmoduletypes.NewMultiEpochHooks(
app.MintKeeper.Hooks()))

tokenFactoryConfig, err := tokenfactorykeeper.ReadConfig(appOpts)
if err != nil {
panic(fmt.Sprintf("error reading token factory config due to %s", err))
}

app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper(
appCodec,
app.keys[tokenfactorytypes.StoreKey],
app.GetSubspace(tokenfactorytypes.ModuleName),
app.AccountKeeper,
app.BankKeeper.(bankkeeper.BaseKeeper).WithMintCoinsRestriction(tokenfactorytypes.NewTokenFactoryDenomMintCoinsRestriction()),
app.DistrKeeper,
tokenFactoryConfig,
)

// The last arguments can contain custom message handlers, and custom query handlers,
Expand Down
4 changes: 4 additions & 0 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking/teststaking"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
tokenfactorykeeper "github.com/sei-protocol/sei-chain/x/tokenfactory/keeper"
"github.com/stretchr/testify/suite"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/config"
Expand Down Expand Up @@ -55,6 +56,9 @@ func (t TestAppOpts) Get(s string) interface{} {
if s == FlagSCEnable {
return t.useSc
}
if s == tokenfactorykeeper.FlagDenomAllowListMaxSize {
return 3
}
return nil
}

Expand Down
Loading

0 comments on commit cfd8cec

Please sign in to comment.