-
Notifications
You must be signed in to change notification settings - Fork 197
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
Fetch start of epoch metablock #3856
Fetch start of epoch metablock #3856
Conversation
@@ -153,6 +153,23 @@ func (ibp *internalBlockProcessor) GetInternalMetaBlockByRound(format common.Api | |||
return ibp.convertMetaBlockBytesByOutputFormat(format, blockBytes) | |||
} | |||
|
|||
// GetInternalStartOfEpochMetaBlock wil return a meta block by hash |
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.
// GetInternalStartOfEpochMetaBlock wil return the epoch start meta block for the provided epoch
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.
also, can you add unit tests for this function ?
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 unit tests
node/external/nodeApiResolver.go
Outdated
@@ -161,6 +161,12 @@ func (nar *nodeApiResolver) GetInternalMetaBlockByRound(format common.ApiOutputF | |||
return nar.apiInternalBlockHandler.GetInternalMetaBlockByRound(format, round) | |||
} | |||
|
|||
// GetInternalStartOfEpochMetaBlock wil return start of epoch meta block |
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.
// GetInternalStartOfEpochMetaBlock will return the start of epoch meta block for the provided epoch
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.
👍
} | ||
|
||
start := time.Now() | ||
block, err := ib.getFacade().GetInternalStartOfEpochMetaBlock(common.ApiOutputFormatInternal, epoch) |
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.
so we have
common.ApiOutputFormatInternal
common.ApiOutputFormatProto
Can we rename ApiOutputFormatInternal to something else? It took me several minutes to figure out which is returning what. InternalMarshalizer is the GogoProtoMarshalizer. I thought they were the same.
Can be done in a separate PR
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.
will do in a separate PR 👍
Implement separate endpoint for fetching start of epoch metablock by specifying the epoch.