Skip to content

Commit

Permalink
Add DAC variant to StorageNodeMode type
Browse files Browse the repository at this point in the history
  • Loading branch information
khssnv committed Aug 8, 2024
1 parent 9496c76 commit 2083b74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 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

0 comments on commit 2083b74

Please sign in to comment.