Skip to content

Commit

Permalink
FEAT: Add outgoing operation hashes in sovereign chain header
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed Oct 27, 2023
1 parent f645305 commit 8a2f422
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 21 deletions.
9 changes: 9 additions & 0 deletions data/block/sovereignChainHeader.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,3 +536,12 @@ func (sch *SovereignChainHeader) CheckFieldsForNil() error {

return nil
}

func (sch *SovereignChainHeader) SetOutGoingOperationHashes(hashes [][]byte) error {
if sch == nil {
return data.ErrNilPointerReceiver
}

sch.OutGoingOperationHashes = hashes
return nil
}
109 changes: 88 additions & 21 deletions data/block/sovereignChainHeader.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions data/block/sovereignChainHeader.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ message SovereignChainHeader {
Header Header = 1 [(gogoproto.jsontag) = "header"];
bytes ValidatorStatsRootHash = 2 [(gogoproto.jsontag) = "validatorStatsRootHash"];
repeated bytes ExtendedShardHeaderHashes = 3 [(gogoproto.jsontag) = "extendedShardHeaderHashes,omitempty"];
repeated bytes OutGoingOperationHashes = 4 [(gogoproto.jsontag) = "outGoingOperationHashes,omitempty"];
}
2 changes: 2 additions & 0 deletions data/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ type SovereignChainHeaderHandler interface {
GetValidatorStatsRootHash() []byte
SetExtendedShardHeaderHashes(hdrHashes [][]byte) error
GetExtendedShardHeaderHashes() [][]byte
SetOutGoingOperationHashes(hashes [][]byte) error
GetOutGoingOperationHashes() [][]byte
}

// HeaderHandler defines getters and setters for header data holder
Expand Down

0 comments on commit 8a2f422

Please sign in to comment.