I am currently writing some unit tests for some Hyperledger Fabric chaincode functions, written in Go.
Some of the functions require a user with certain attributes or indeed just need to know the user's ID.
For example, some of the functions use the following methods from the github.com/hyperledger/fabric-chaincode-go/pkg/cid package:
cid.GetID()
cid.AssertAttributeValue()
I don't see how to create and / or pass an identity / certificate when using the mock shim package, github.com/hyperledger/fabric-chaincode-go/shimtest and calls fail with: failed to get transaction invoker's identity from the chaincode stub
Is it maybe possible to create and use fake, but acceptable certificates? Or is there some better way to mock these ACL parts?
Considering Hyperledger bills itself as being permissioned and having strict ACL opportunities, it seems surprising that this can't be tested (hence, I think I'm missing something!).