Fix deployment of chaincode with higher version than 9 issue (#243)

This script fails if chaincode version is higher than 9 as 'grep' does not match ex. version equal to '10'

Signed-off-by: Titas <titas.petravicius@gmail.com>
Signed-off-by: lehors <lehors@us.ibm.com>

Co-authored-by: Arnaud J Le Hors <lehors@us.ibm.com>
This commit is contained in:
Titas 2020-08-06 23:59:25 +03:00 committed by GitHub
parent c0ffb1cffb
commit 0031db5de2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -269,7 +269,7 @@ queryCommitted() {
peer lifecycle chaincode querycommitted --channelID $CHANNEL_NAME --name ${CC_NAME} >&log.txt
res=$?
set +x
test $res -eq 0 && VALUE=$(cat log.txt | grep -o '^Version: '$CC_VERSION', Sequence: [0-9], Endorsement Plugin: escc, Validation Plugin: vscc')
test $res -eq 0 && VALUE=$(cat log.txt | grep -o '^Version: '$CC_VERSION', Sequence: [0-9]*, Endorsement Plugin: escc, Validation Plugin: vscc')
test "$VALUE" = "$EXPECTED_RESULT" && let rc=0
COUNTER=$(expr $COUNTER + 1)
done