Skip to content

Commit

Permalink
fix: add GlobalVirtualGroupFamilyId to createBucketPackage (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 authored Oct 17, 2023
1 parent dbddf7d commit 148c9c4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
5 changes: 3 additions & 2 deletions x/storage/keeper/cross_app_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ func (app *BucketApp) handleCreateBucketSynPackage(ctx sdk.Context, appCtx *sdk.
ChargedReadQuota: createBucketPackage.ChargedReadQuota,
PaymentAddress: createBucketPackage.PaymentAddress.String(),
PrimarySpApproval: &common.Approval{
ExpiredHeight: createBucketPackage.PrimarySpApprovalExpiredHeight,
Sig: createBucketPackage.PrimarySpApprovalSignature,
ExpiredHeight: createBucketPackage.PrimarySpApprovalExpiredHeight,
GlobalVirtualGroupFamilyId: createBucketPackage.GlobalVirtualGroupFamilyId,
Sig: createBucketPackage.PrimarySpApprovalSignature,
},
ApprovalMsgBytes: createBucketPackage.GetApprovalBytes(),
},
Expand Down
15 changes: 11 additions & 4 deletions x/storage/types/crosschain.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ type CreateBucketSynPackage struct {
PaymentAddress sdk.AccAddress
PrimarySpAddress sdk.AccAddress
PrimarySpApprovalExpiredHeight uint64
GlobalVirtualGroupFamilyId uint32
PrimarySpApprovalSignature []byte
ChargedReadQuota uint64
ExtraData []byte
Expand All @@ -359,6 +360,7 @@ type CreateBucketSynPackageStruct struct {
PaymentAddress common.Address
PrimarySpAddress common.Address
PrimarySpApprovalExpiredHeight uint64
GlobalVirtualGroupFamilyId uint32
PrimarySpApprovalSignature []byte
ChargedReadQuota uint64
ExtraData []byte
Expand All @@ -372,6 +374,7 @@ var (
{Name: "PaymentAddress", Type: "address"},
{Name: "PrimarySpAddress", Type: "address"},
{Name: "PrimarySpApprovalExpiredHeight", Type: "uint64"},
{Name: "GlobalVirtualGroupFamilyId", Type: "uint32"},
{Name: "PrimarySpApprovalSignature", Type: "bytes"},
{Name: "ChargedReadQuota", Type: "uint64"},
{Name: "ExtraData", Type: "bytes"},
Expand All @@ -390,6 +393,7 @@ func (p CreateBucketSynPackage) MustSerialize() []byte {
PaymentAddress: common.BytesToAddress(p.PaymentAddress),
PrimarySpAddress: common.BytesToAddress(p.PrimarySpAddress),
PrimarySpApprovalExpiredHeight: p.PrimarySpApprovalExpiredHeight,
GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId,
PrimarySpApprovalSignature: p.PrimarySpApprovalSignature,
ChargedReadQuota: p.ChargedReadQuota,
ExtraData: p.ExtraData,
Expand All @@ -408,8 +412,9 @@ func (p CreateBucketSynPackage) ValidateBasic() error {
PaymentAddress: p.PaymentAddress.String(),
PrimarySpAddress: p.PrimarySpAddress.String(),
PrimarySpApproval: &gnfdcommon.Approval{
ExpiredHeight: p.PrimarySpApprovalExpiredHeight,
Sig: p.PrimarySpApprovalSignature,
ExpiredHeight: p.PrimarySpApprovalExpiredHeight,
GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId,
Sig: p.PrimarySpApprovalSignature,
},
ChargedReadQuota: p.ChargedReadQuota,
}
Expand All @@ -425,8 +430,9 @@ func (p CreateBucketSynPackage) GetApprovalBytes() []byte {
PaymentAddress: p.PaymentAddress.String(),
PrimarySpAddress: p.PrimarySpAddress.String(),
PrimarySpApproval: &gnfdcommon.Approval{
ExpiredHeight: p.PrimarySpApprovalExpiredHeight,
Sig: p.PrimarySpApprovalSignature,
ExpiredHeight: p.PrimarySpApprovalExpiredHeight,
GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId,
Sig: p.PrimarySpApprovalSignature,
},
ChargedReadQuota: p.ChargedReadQuota,
}
Expand All @@ -452,6 +458,7 @@ func DeserializeCreateBucketSynPackage(serializedPackage []byte) (interface{}, e
pkgStruct.PaymentAddress.Bytes(),
pkgStruct.PrimarySpAddress.Bytes(),
pkgStruct.PrimarySpApprovalExpiredHeight,
pkgStruct.GlobalVirtualGroupFamilyId,
pkgStruct.PrimarySpApprovalSignature,
pkgStruct.ChargedReadQuota,
pkgStruct.ExtraData,
Expand Down

0 comments on commit 148c9c4

Please sign in to comment.