-
Notifications
You must be signed in to change notification settings - Fork 206
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
Previous header proof in block structure #6814
Previous header proof in block structure #6814
Conversation
node/external/blockAPI/baseBlock.go
Outdated
|
||
func addPreviousHeaderProof(header data.HeaderHandler, apiBlock *api.Block) { | ||
prevHeaderProof := header.GetPreviousProof() | ||
if prevHeaderProof == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if prevHeaderProof == nil { | |
if check.IfNilReflect(prevHeaderProof) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -410,6 +410,34 @@ func TestAddScheduledInfoInBlock(t *testing.T) { | |||
}, apiBlock) | |||
} | |||
|
|||
func TestAddPreviousHeaderProofInBlock(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Paralel() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
apiBlock := &api.Block{} | ||
addPreviousHeaderProof(blockHeader, apiBlock) | ||
require.Equal(t, &api.HeaderProof{ | ||
PubKeysBitmap: "6269746d6170", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use hex.Encode / Decode and extract it to some "provided..." variables, for more clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
The base branch was changed.
…re-header-proof # Conflicts: # go.mod # go.sum
Reasoning behind the pull request
Proposed changes
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?