Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blockchain runtime v54112 support #103

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions blockchain/pallets/ddcclusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import (
)

type Cluster struct {
ClusterId ClusterId
ManagerId types.AccountID
ReserveId types.AccountID
Props ClusterProps
Status ClusterStatus
ClusterId ClusterId
ManagerId types.AccountID
ReserveId types.AccountID
Props ClusterProps
Status ClusterStatus
LastValidatedEraId DdcEra
}

type ClusterProps struct {
Expand Down
11 changes: 6 additions & 5 deletions blockchain/pallets/ddccustomers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ type AccountsLedger struct {
}

type Bucket struct {
BucketId BucketId
OwnerId types.AccountID
ClusterId ClusterId
IsPublic types.Bool
IsRemoved types.Bool
BucketId BucketId
OwnerId types.AccountID
ClusterId ClusterId
IsPublic types.Bool
IsRemoved types.Bool
TotalCustomersUsage types.Option[CustomerUsage]
}

type UnlockChunk struct {
Expand Down
12 changes: 12 additions & 0 deletions blockchain/pallets/primitives.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type StorageNodeMode struct {
IsFull bool
IsStorage bool
IsCache bool
IsDac bool
}

func (m *StorageNodeMode) Decode(decoder scale.Decoder) error {
Expand All @@ -94,6 +95,8 @@ func (m *StorageNodeMode) Decode(decoder scale.Decoder) error {
m.IsStorage = true
} else if b == 3 {
m.IsCache = true
} else if b == 4 {
m.IsDac = true
} else {
return ErrUnknownVariant
}
Expand All @@ -109,6 +112,8 @@ func (m StorageNodeMode) Encode(encoder scale.Encoder) error {
err = encoder.PushByte(2)
} else if m.IsCache {
err = encoder.PushByte(3)
} else if m.IsDac {
err = encoder.PushByte(4)
} else {
return ErrUnknownVariant
}
Expand Down Expand Up @@ -169,3 +174,10 @@ func (m ClusterStatus) Encode(encoder scale.Encoder) error {

return nil
}

type CustomerUsage struct {
TransferredBytes types.U64
StoredBytes types.I64
NumberOfPuts types.U64
NumberOfGets types.U64
}
Loading