Skip to content

Commit

Permalink
Merge pull request #495 from bnb-chain/develop
Browse files Browse the repository at this point in the history
release: prepare release for v0.2.6-hf.1
  • Loading branch information
randyahx committed Sep 25, 2023
2 parents 7e03350 + 06ecbe9 commit db447a9
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 125 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v0.2.6-hf.1
This is a hotfix version to enable the chain to emit deposit events for user accounts and add local virtual group id for related events.

Chores:
* [#489](https://github.com/bnb-chain/greenfield/pull/489) chore: add deposit event for user account
* [#490](https://github.com/bnb-chain/greenfield/pull/490) chore: add lvg id to related events

## v0.2.6
This is a maintenance release to update the cosmos-sdk dependency to the latest version.

Expand Down
4 changes: 4 additions & 0 deletions proto/greenfield/storage/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ message EventCreateObject {
SourceType source_type = 15;
// checksums define the total checksums of the object which generated by redundancy
repeated bytes checksums = 16;
// local_virtual_group_id defines the unique id of lvg which the object stored
uint32 local_virtual_group_id = 17;
}

// EventCancelCreateObject is emitted on MsgCancelCreateObject
Expand Down Expand Up @@ -201,6 +203,8 @@ message EventCopyObject {
(gogoproto.customtype) = "Uint",
(gogoproto.nullable) = false
];
// local_virtual_group_id defines the unique id of lvg which the object stored
uint32 local_virtual_group_id = 8;
}

// EventDeleteObject is emitted on MsgDeleteObject
Expand Down
6 changes: 6 additions & 0 deletions x/payment/keeper/stream_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ func (k Keeper) UpdateStreamRecord(ctx sdk.Context, streamRecord *types.StreamRe
ctx.Logger().Info("auto transfer failed", "account", streamRecord.Account, "err", err, "coins", coins)
} else {
streamRecord.StaticBalance = sdkmath.ZeroInt()
// emit event for self deposit of owner account
_ = ctx.EventManager().EmitTypedEvents(&types.EventDeposit{
From: account.String(),
To: account.String(),
Amount: coins.AmountOf(params.FeeDenom),
})
}
}
}
Expand Down
46 changes: 24 additions & 22 deletions x/storage/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,21 +637,22 @@ func (k Keeper) CreateObject(
store.Set(types.GetObjectByIDKey(objectInfo.Id), obz)

if err = ctx.EventManager().EmitTypedEvents(&types.EventCreateObject{
Creator: operator.String(),
Owner: objectInfo.Owner,
BucketName: bucketInfo.BucketName,
ObjectName: objectInfo.ObjectName,
BucketId: bucketInfo.Id,
ObjectId: objectInfo.Id,
CreateAt: objectInfo.CreateAt,
PayloadSize: objectInfo.PayloadSize,
Visibility: objectInfo.Visibility,
PrimarySpId: sp.Id,
ContentType: objectInfo.ContentType,
Status: objectInfo.ObjectStatus,
RedundancyType: objectInfo.RedundancyType,
SourceType: objectInfo.SourceType,
Checksums: objectInfo.Checksums,
Creator: operator.String(),
Owner: objectInfo.Owner,
BucketName: bucketInfo.BucketName,
ObjectName: objectInfo.ObjectName,
BucketId: bucketInfo.Id,
ObjectId: objectInfo.Id,
CreateAt: objectInfo.CreateAt,
PayloadSize: objectInfo.PayloadSize,
Visibility: objectInfo.Visibility,
PrimarySpId: sp.Id,
ContentType: objectInfo.ContentType,
Status: objectInfo.ObjectStatus,
RedundancyType: objectInfo.RedundancyType,
SourceType: objectInfo.SourceType,
Checksums: objectInfo.Checksums,
LocalVirtualGroupId: objectInfo.LocalVirtualGroupId,
}); err != nil {
return objectInfo.Id, err
}
Expand Down Expand Up @@ -1071,13 +1072,14 @@ func (k Keeper) CopyObject(
store.Set(types.GetObjectByIDKey(objectInfo.Id), obz)

if err := ctx.EventManager().EmitTypedEvents(&types.EventCopyObject{
Operator: operator.String(),
SrcBucketName: srcObjectInfo.BucketName,
SrcObjectName: srcObjectInfo.ObjectName,
DstBucketName: objectInfo.BucketName,
DstObjectName: objectInfo.ObjectName,
SrcObjectId: srcObjectInfo.Id,
DstObjectId: objectInfo.Id,
Operator: operator.String(),
SrcBucketName: srcObjectInfo.BucketName,
SrcObjectName: srcObjectInfo.ObjectName,
DstBucketName: objectInfo.BucketName,
DstObjectName: objectInfo.ObjectName,
SrcObjectId: srcObjectInfo.Id,
DstObjectId: objectInfo.Id,
LocalVirtualGroupId: objectInfo.LocalVirtualGroupId,
}); err != nil {
return sdkmath.ZeroUint(), err
}
Expand Down
Loading

0 comments on commit db447a9

Please sign in to comment.