Skip to content

Commit

Permalink
fix: hardfork bug
Browse files Browse the repository at this point in the history
  • Loading branch information
constwz committed Jul 11, 2024
1 parent d35a9ce commit 3f3e626
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 3 additions & 1 deletion x/storage/keeper/cross_app_permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package keeper

import (
"cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

types2 "github.com/bnb-chain/greenfield/types"
gnfderrors "github.com/bnb-chain/greenfield/types/errors"
Expand Down Expand Up @@ -167,7 +169,7 @@ func (app *PermissionApp) handleCreatePolicySynPackage(ctx sdk.Context, createPo
policy.Statements = crossChainPolicy.Statements
var resOwner sdk.AccAddress
var resId math.Uint
if crossChainPolicy.GetResourceGRN() != "" {
if ctx.IsUpgraded(upgradetypes.Mongolian) && crossChainPolicy.GetResourceGRN() != "" {
err = grn.ParseFromString(crossChainPolicy.GetResourceGRN(), true)
if err != nil {
return sdk.ExecuteResult{
Expand Down
8 changes: 0 additions & 8 deletions x/storage/keeper/cross_app_permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,6 @@ func (s *TestSuite) TestSynCreatePolicyByMsg() {
serializedSynPackage = append([]byte{storageTypes.OperationCreatePolicy}, serializedSynPackage...)

storageKeeper.EXPECT().GetResourceOwnerAndIdFromGRN(gomock.Any(), gomock.Any()).Return(op, resourceIds[0], nil).AnyTimes()
//storageKeeper.EXPECT().GetBucketInfo(gomock.Any(), gomock.Any()).Return(&storageTypes.BucketInfo{
// Owner: op.String(),
// BucketName: "test-bucket",
//}, true)
//storageKeeper.EXPECT().GetBucketInfoById(gomock.Any(), gomock.Any()).Return(&storageTypes.BucketInfo{
// Owner: op.String(),
// BucketName: "test-bucket",
//}, true)
storageKeeper.EXPECT().NormalizePrincipal(gomock.Any(), gomock.Any()).Return().AnyTimes()
storageKeeper.EXPECT().ValidatePrincipal(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
permissionKeeper.EXPECT().PutPolicy(gomock.Any(), gomock.Any()).Return(math.NewUint(1), nil).AnyTimes()
Expand Down

0 comments on commit 3f3e626

Please sign in to comment.