Skip to content

Commit

Permalink
fix: Remove cross-chain operation restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
constwz committed Jul 10, 2024
1 parent 86a744a commit 2aafd0b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions x/storage/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (k Keeper) DeleteBucket(ctx sdk.Context, operator sdk.AccAddress, bucketNam
if !found {
return types.ErrNoSuchBucket
}
if bucketInfo.SourceType != opts.SourceType {
if bucketInfo.SourceType != types.SOURCE_TYPE_ORIGIN && bucketInfo.SourceType != opts.SourceType {
return types.ErrSourceTypeMismatch
}

Expand Down Expand Up @@ -417,10 +417,6 @@ func (k Keeper) UpdateBucketInfo(ctx sdk.Context, operator sdk.AccAddress, bucke
if !found {
return types.ErrNoSuchBucket
}
// check bucket source
if bucketInfo.SourceType != opts.SourceType {
return types.ErrSourceTypeMismatch
}

if ctx.IsUpgraded(upgradetypes.Hulunbeier) {
sp := k.MustGetPrimarySPForBucket(ctx, bucketInfo)
Expand Down Expand Up @@ -1056,7 +1052,7 @@ func (k Keeper) DeleteObject(
objectInfo.ObjectName)
}

if objectInfo.SourceType != opts.SourceType {
if objectInfo.SourceType != types.SOURCE_TYPE_ORIGIN && objectInfo.SourceType != opts.SourceType {
return types.ErrSourceTypeMismatch
}

Expand Down Expand Up @@ -1552,7 +1548,7 @@ func (k Keeper) DeleteGroup(ctx sdk.Context, operator sdk.AccAddress, groupName
if !found {
return types.ErrNoSuchGroup
}
if groupInfo.SourceType != opts.SourceType {
if groupInfo.SourceType != types.SOURCE_TYPE_ORIGIN && groupInfo.SourceType != opts.SourceType {
return types.ErrSourceTypeMismatch
}
// check permission
Expand Down Expand Up @@ -1588,7 +1584,7 @@ func (k Keeper) LeaveGroup(
if !found {
return types.ErrNoSuchGroup
}
if groupInfo.SourceType != opts.SourceType {
if groupInfo.SourceType != types.SOURCE_TYPE_ORIGIN && groupInfo.SourceType != opts.SourceType {
return types.ErrSourceTypeMismatch
}

Expand All @@ -1610,7 +1606,7 @@ func (k Keeper) LeaveGroup(
}

func (k Keeper) UpdateGroupMember(ctx sdk.Context, operator sdk.AccAddress, groupInfo *types.GroupInfo, opts types.UpdateGroupMemberOptions) error {
if groupInfo.SourceType != opts.SourceType {
if groupInfo.SourceType != types.SOURCE_TYPE_ORIGIN && groupInfo.SourceType != opts.SourceType {
return types.ErrSourceTypeMismatch
}

Expand Down Expand Up @@ -1665,7 +1661,7 @@ func (k Keeper) UpdateGroupMember(ctx sdk.Context, operator sdk.AccAddress, grou
}

func (k Keeper) RenewGroupMember(ctx sdk.Context, operator sdk.AccAddress, groupInfo *types.GroupInfo, opts types.RenewGroupMemberOptions) error {
if groupInfo.SourceType != opts.SourceType {
if groupInfo.SourceType != types.SOURCE_TYPE_ORIGIN && groupInfo.SourceType != opts.SourceType {
return types.ErrSourceTypeMismatch
}

Expand Down

0 comments on commit 2aafd0b

Please sign in to comment.