Skip to content

Commit

Permalink
add upgrade name
Browse files Browse the repository at this point in the history
  • Loading branch information
forcodedancing committed Sep 18, 2023
1 parent f4c9ff2 commit 6df9702
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion deployment/localup/localup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function generate_genesis() {
#sed -i -e "s/\"community_tax\": \"0.020000000000000000\"/\"community_tax\": \"0\"/g" ${workspace}/.local/validator${i}/config/genesis.json
sed -i -e "s/log_level = \"info\"/\log_level= \"debug\"/g" ${workspace}/.local/validator${i}/config/config.toml
echo -e '[[upgrade]]\nname = "Nagqu"\nheight = 20\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml
echo -e '[[upgrade]]\nname = "Xxxxx"\nheight = 20\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml
echo -e '[[upgrade]]\nname = "Pampas"\nheight = 20\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml
done

# enable swagger API for validator0
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ replace (
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.3
github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20230918062228-f66797bea5a1
github.com/cosmos/cosmos-sdk => github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20230918080629-546708eba818
github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20230918062228-f66797bea5a1 h1:UHVhaT7PI9wXgzrzlK+gl7YxuSFokYMyqWWHOut/104=
github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20230918062228-f66797bea5a1/go.mod h1:y3hDhQhil5hMIhwBTpu07RZBF30ZITkoE+GHhVZChtY=
github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20230918080629-546708eba818 h1:HyAROtp8xHuuzZzJTXfwVm0c+qTJs3ahPFtEpJFs5lM=
github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20230918080629-546708eba818/go.mod h1:y3hDhQhil5hMIhwBTpu07RZBF30ZITkoE+GHhVZChtY=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
Expand Down
6 changes: 3 additions & 3 deletions x/permission/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (

ACTION_TYPE_ALL: true,
}
BucketAllowedActionsAfterXxxxx = map[ActionType]bool{
BucketAllowedActionsAfterPampas = map[ActionType]bool{
ACTION_UPDATE_BUCKET_INFO: true,
ACTION_DELETE_BUCKET: true,

Expand Down Expand Up @@ -256,8 +256,8 @@ func (s *Statement) ValidateAfterNagqu(resType resource.ResourceType) error {

func (s *Statement) ValidateRuntime(ctx sdk.Context, resType resource.ResourceType) error {
var bucketAllowedActions map[ActionType]bool
if ctx.IsUpgraded(upgradetypes.Xxxxx) {
bucketAllowedActions = BucketAllowedActionsAfterXxxxx
if ctx.IsUpgraded(upgradetypes.Pampas) {
bucketAllowedActions = BucketAllowedActionsAfterPampas
} else {
bucketAllowedActions = BucketAllowedActions
}
Expand Down
17 changes: 7 additions & 10 deletions x/storage/types/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -1188,17 +1188,14 @@ func (msg *MsgPutPolicy) ValidateBasic() error {
}

func (msg *MsgPutPolicy) ValidateRuntime(ctx sdk.Context) error {
if ctx.IsUpgraded(upgradetypes.Xxxxx) {
var grn grn2.GRN
_ = grn.ParseFromString(msg.Resource, true) // no error after ValidateBasic
for _, s := range msg.Statements {
err := s.ValidateRuntime(ctx, grn.ResourceType())
if err != nil {
return err
}
var grn grn2.GRN
_ = grn.ParseFromString(msg.Resource, true) // no error after ValidateBasic
for _, s := range msg.Statements {
err := s.ValidateRuntime(ctx, grn.ResourceType())
if err != nil {
return err
}
}

return nil
}

Expand Down Expand Up @@ -1255,7 +1252,7 @@ func (msg *MsgDeletePolicy) ValidateBasic() error {
}

func (msg *MsgDeletePolicy) ValidateRuntime(ctx sdk.Context) error {
if ctx.IsUpgraded(upgradetypes.Xxxxx) {
if ctx.IsUpgraded(upgradetypes.Pampas) {
if err := msg.Principal.ValidateBasic(); err != nil {
return err
}
Expand Down

0 comments on commit 6df9702

Please sign in to comment.