Bug Hunting demo project
This is a example project on how to debug and test a Convector Smart Contracts project.
Find the details in this Medium post.
Beware that this project uses Convector 1.3.0
Details on the use case
The controller in this project has 3 main functions.
create. This will create a dummy model in the ledger and set the
this.sender(a.k.a the wallet/certificate sending the request).
getOne. This will just return one item by it's id.
update. This will try to update the model but will first check that the requesting wallet/cert is the authorized (the one set in the
ownerproperty), if not, a
Ups, the requesting identity is not authorized to update the modelwill be returned.
The test is fairly simple
should create a default model. Create a dummy model.
should find the model. Find it to check it the
createfunction still works fine.
try to update without success. Change the identity of the mock adapter and expect a rejection.
try to update with success. Switch to the original certificate and expect a successful modification of data.
Check all the information to work with Convector in the DOCS site.