Skip to content
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

Merged
merged 4 commits into from
Apr 3, 2019

Conversation

anandrgitnirman
Copy link
Contributor

#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()

anandrgitnirman and others added 2 commits April 2, 2019 11:15
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()
@anandrgitnirman
Copy link
Contributor Author

@astroseger , tested this , works fine with claim now

@vsbogd , request your review on this

@anandrgitnirman anandrgitnirman requested a review from vsbogd April 3, 2019 10:45
escrow/escrow.go Outdated Show resolved Hide resolved
escrow/escrow_test.go Outdated Show resolved Hide resolved
@@ -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() {
Copy link
Member

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()
Copy link
Member

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.

Copy link
Contributor Author

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 :)

…bute to test the scenario in hand

Simplified the test case by making it more readable
(code review comments)
@vsbogd vsbogd merged commit 812e2a1 into singnet:master Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants