Skip to content

Commit

Permalink
Merge pull request #103 from Cerebellum-Network/feature/blockchain-ru…
Browse files Browse the repository at this point in the history
…ntime-v54112-support

Blockchain runtime v54112 support
  • Loading branch information
khssnv committed Aug 8, 2024
2 parents be97bee + 2083b74 commit 1a953fd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
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
}

0 comments on commit 1a953fd

Please sign in to comment.