diff --git a/x/storage/keeper/keeper.go b/x/storage/keeper/keeper.go index 199424d12..72d0642ab 100644 --- a/x/storage/keeper/keeper.go +++ b/x/storage/keeper/keeper.go @@ -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 } @@ -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) @@ -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 } @@ -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 @@ -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 } @@ -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 } @@ -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 }