-
Notifications
You must be signed in to change notification settings - Fork 118
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
Rianhughes/07 get block with receipts #517
Conversation
Todo: update tests when juno supports rpc v07 |
The PR, in general, looks good, however, it still needs to be updated as per your comment. I can have a look again after you have updated it. |
rpc/block.go
Outdated
return &block, nil | ||
} | ||
|
||
// if result.Status == nil it's a pending 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.
This is incorrect, please see here. If the block is pending then the status should be "PENDING"
.
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.
getBlockWithReceipts can return a BLOCK_WITH_RECEIPTSwhich has a BLOCK_STATUS (which may be "PENDING"), however getBlockWithReceipts can also return a distinct type PENDING_BLOCK_WITH_RECEIPTS which has no BLOCK_STATUS.
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.
The naming could be clearer tbh (on the spec side), but I think the current implementation is correct.
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.
I've updated the logic to make this a bit clearer, but it's essentially the same
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.
Yeah looks like the spec is ambiguous
closes #516
Edit: This PR incorporates the changes from rc-1 which relate to block receipts