-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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 block-number along with validation code for a given TXID #2614
Conversation
Add committing block number, along with validation code for a given TXID Signed-off-by: manish <manish.sethi@gmail.com>
d3fa9b8
to
a26dd62
Compare
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.
One comment about a single-use function, but other than that change seems fine to me
@@ -444,6 +448,11 @@ func retrieveTxID(encodedTxIDKey []byte) (string, error) { | |||
return string(remainingBytes[:int(txIDLen)]), nil | |||
} | |||
|
|||
func retrieveBlockNum(encodedTxIDKey []byte, BlkNumStartingIndex int) (uint64, error) { |
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.
Do we really need a separate function for this? As far as I can tell, it's only has one consumer.
@@ -93,7 +93,7 @@ func (store *BlockStore) RetrieveBlockByTxID(txID string) (*common.Block, error) | |||
} | |||
|
|||
// RetrieveTxValidationCodeByTxID returns the validation code for the specified txID | |||
func (store *BlockStore) RetrieveTxValidationCodeByTxID(txID string) (peer.TxValidationCode, error) { | |||
func (store *BlockStore) RetrieveTxValidationCodeByTxID(txID string) (peer.TxValidationCode, uint64, error) { |
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 a change to a public method, but given Fabric is not designed to be a library, I don't think we need to document the API change.
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.
Good Catch! I'll fix this in a separate PR to avoid delay merging in this.
@@ -1450,9 +1450,9 @@ func (m *mockLedger) GetBlockByTxID(txID string) (*common.Block, error) { | |||
} | |||
|
|||
// GetTxValidationCodeByTxID returns validation code of give tx | |||
func (m *mockLedger) GetTxValidationCodeByTxID(txID string) (peer.TxValidationCode, error) { | |||
func (m *mockLedger) GetTxValidationCodeByTxID(txID string) (peer.TxValidationCode, uint64, error) { |
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 a change to a public method, but given Fabric is not designed to be a library, I don't think we need to document the API change.
Signed-off-by: manish manish.sethi@gmail.com
Type of change
Description
This allows gateway to pass on additional relevant info to client and for using it for logging that could be helpful in debugging