-
Notifications
You must be signed in to change notification settings - Fork 51
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
Issue 224: Ensure Claim does not fail even when group ID changes #240
Conversation
merge latest in to version
Ensure Group ID check should only apply at the time of storing channel state in etcd for the first time Moved the group ID check from BlockchainChannelReader to lockingPaymentChannelService.PaymentChannel()
@astroseger , tested this , works fine with claim now @vsbogd , request your review on this |
@@ -280,3 +281,41 @@ func (suite *PaymentChannelServiceSuite) TestStartClaim() { | |||
assert.Equal(suite.T(), suite.payment(), claim.Payment()) | |||
assert.Equal(suite.T(), []*Payment{suite.payment()}, claims) | |||
} | |||
|
|||
func (suite *PaymentChannelServiceSuite) TestVerifyGroupId() { |
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.
👍
//Group ID check is only done for the first time , when the channel is added to storage from the block chain , | ||
//if the channel is already present in the storage the group ID check is skipped. | ||
if blockchainChannel != nil { | ||
blockChainGroupID,err := h.blockchainReader.replicaGroupID() |
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.
As replicaGroupId
is not used in blockchain reader anymore I would move it into lockingPaymentChannelService
itself. But it will probably require fixing unit tests, so it makes sense to do separate PR for this.
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 submit a separate PR by tomorrow , hopefully by then this is approved :)
…vate ( from VerifyGroupId to verifygroupId)
…bute to test the scenario in hand Simplified the test case by making it more readable (code review comments)
#224
Ensure Group ID check should only apply at the time of storing channel state in etcd for the first time
Moved the group ID check from BlockchainChannelReader to lockingPaymentChannelService.PaymentChannel()