To Test execute invoke/query .... everytime invoke is called value will increment by 10
9. Execute invoke chain.sh invoke
10. Execute query chain.sh query
Solution to exercise
Solution is in the delstate.go
Add the following to the invoke function
// Solution to the exercise
else if(funcName == "delete"){
// Delete the token
return DeleteToken(stub)
}
Testing the Solution
PS: You may use it with original version of the token/v5 but keep in mind that the last step will FAIL which is fine as the "delete" function is not supported by the original token/v5 implementation
Using the test.sh file
The test may be run net & dev mode.
Prior to running the test install & instantiate the chaincode
Launch the setup in net mode
dev-init.sh
Set the org context
. set-env.sh acme
Set the chaincode env
set-chain-env.sh -n token -v 1.0 -p token/v5
set-chain-env.sh -i '{"args":["set"]}' -q '{"args":["get"]}'