Implement Session.Close with force option. Add tests in session,
app/payment and api/grpc packages. Update Error message definition in
proto buff, to also include a list of openChsInfo.
Rename GetPayChs API in grpc package to GetPayChsInfo.
Change concurrency pattern in session/role_integ_test.go to call
wg.Wait() in defer statement instead of end of the code section. This is
because, in previous pattern (calling at end), Wait() is never called if
any of the "require" assertions fail, ending the test before the
go-routine can finish.
Also unexport the following conversion functions as they are not used
outside of the respective packages: toPayChInfo, toPayChsInfo in
app/payment and toGrpcXXXX functions in api/grpc package.
Category
Implementation Task
Relevant issue
Closes #111.
Testing
Added tests (as sub tests) to Test_Integ_Role test in session package and api/grpc package.
Also added tests in payment package to cover session close.
Steps to run the tests
Start the ganache cli-node: ganache-cli -b 1 --account="0x1fedd636dbc7e8d41a0622a2040b86fea8842cef9d4aa4c582aad00465b7acff,100000000000000000000" \ --account="0xb0309c60b4622d3071fad3e16c2ce4d0b1e7758316c187754f4dd0cfb44ceb33,100000000000000000000"
Run all tests, including integration tests: go test -tags=integration -count=1 -cover ./...
Checklist
[x] Name is added to the NOTICE file, if it is not present already.
Description
Implement Session.Close with force option. Add tests in session, app/payment and api/grpc packages. Update Error message definition in proto buff, to also include a list of openChsInfo.
Rename GetPayChs API in grpc package to GetPayChsInfo.
Change concurrency pattern in session/role_integ_test.go to call wg.Wait() in defer statement instead of end of the code section. This is because, in previous pattern (calling at end), Wait() is never called if any of the "require" assertions fail, ending the test before the go-routine can finish.
Also unexport the following conversion functions as they are not used outside of the respective packages: toPayChInfo, toPayChsInfo in app/payment and toGrpcXXXX functions in api/grpc package.
Category
Implementation Task
Relevant issue
Closes #111.
Testing
Added tests (as sub tests) to
Test_Integ_Role
test insession
package andapi/grpc
package. Also added tests in payment package to cover session close.Steps to run the tests
ganache-cli -b 1 --account="0x1fedd636dbc7e8d41a0622a2040b86fea8842cef9d4aa4c582aad00465b7acff,100000000000000000000" \ --account="0xb0309c60b4622d3071fad3e16c2ce4d0b1e7758316c187754f4dd0cfb44ceb33,100000000000000000000"
go test -tags=integration -count=1 -cover ./...
Checklist