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

add is start of epoch flag on proof #346

Open
wants to merge 5 commits into
base: extend_shard_data
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions data/block/blockV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,5 +679,7 @@ func (hv2 *HeaderV2) SetPreviousProof(proof data.HeaderProofHandler) {
HeaderEpoch: proof.GetHeaderEpoch(),
HeaderNonce: proof.GetHeaderNonce(),
HeaderShardId: proof.GetHeaderShardId(),
HeaderRound: proof.GetHeaderRound(),
IsStartOfEpoch: proof.GetIsStartOfEpoch(),
}
}
154 changes: 101 additions & 53 deletions data/block/blockV2.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/blockV2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ message HeaderProof {
uint64 HeaderNonce = 5 [(gogoproto.jsontag) = "headerNonce"];
uint32 HeaderShardId = 6 [(gogoproto.jsontag) = "headerShardId"];
uint64 HeaderRound = 7 [(gogoproto.jsontag) = "headerRound"];
bool IsStartOfEpoch = 8 [(gogoproto.jsontag) = "isStartOfEpoch"];
}
1 change: 1 addition & 0 deletions data/block/metaBlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,5 +582,6 @@ func (m *MetaBlock) SetPreviousProof(proof data.HeaderProofHandler) {
HeaderNonce: proof.GetHeaderNonce(),
HeaderShardId: proof.GetHeaderShardId(),
HeaderRound: proof.GetHeaderRound(),
IsStartOfEpoch: proof.GetIsStartOfEpoch(),
}
}
2 changes: 2 additions & 0 deletions data/block/metaBlock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ func TestMetaBlock2_GetPreviousProof(t *testing.T) {
HeaderNonce: 234,
HeaderShardId: 0,
HeaderRound: 345,
IsStartOfEpoch: true,
}

metaBlock.SetPreviousProof(previousProof)
Expand All @@ -430,4 +431,5 @@ func TestMetaBlock2_GetPreviousProof(t *testing.T) {
require.Equal(t, previousProof.HeaderNonce, proof.GetHeaderNonce())
require.Equal(t, previousProof.HeaderShardId, proof.GetHeaderShardId())
require.Equal(t, previousProof.HeaderRound, proof.GetHeaderRound())
require.Equal(t, previousProof.IsStartOfEpoch, proof.GetIsStartOfEpoch())
}
1 change: 1 addition & 0 deletions data/block/shardDataHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func (sd *ShardData) SetPreviousProof(proof data.HeaderProofHandler) error {
HeaderNonce: proof.GetHeaderNonce(),
HeaderShardId: proof.GetHeaderShardId(),
HeaderRound: proof.GetHeaderRound(),
IsStartOfEpoch: proof.GetIsStartOfEpoch(),
}

return nil
Expand Down
1 change: 1 addition & 0 deletions data/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ type HeaderProofHandler interface {
GetHeaderNonce() uint64
GetHeaderShardId() uint32
GetHeaderRound() uint64
GetIsStartOfEpoch() bool
}

// ShardHeaderHandler defines getters and setters for the shard block header
Expand Down
Loading