Commit graph

21 commits

Author SHA1 Message Date
Brett Logan
bd38f9220b Capitalize Function Names
Short of creating a second application that calls
the lowerCase version of functions, since Go requires
the functions be exported, capitalizing them in the
Node and Typescript chaincode seems the simplest solution

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Brett Logan
06c42bf68b Clean up Node Application and Address Linting Issues
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Brett Logan
73a62a6780 Clean up Node Chaincode and Address Linting Issues
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Brett Logan
e31ecf3165 Decorate Typescript Chaincode
Add the contract-api specific annotations and
enable the experimental features.

Also properly format code according to the linter

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Brett Logan
66b4b2b86a Remove Typescript Application
As the typescript application shows no Fabric
specific features we have elected to remove it

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Arnaud J Le Hors
7771b4f216
Revert "Remove Typescript References (#258)" (#261)
This reverts commit 7a23d7872a.
2020-07-23 17:06:57 +02:00
Brett Logan
7a23d7872a
Remove Typescript References (#258)
As the Typescript examples are essentially just reiterations
of the same Javascript code, there is no benefit to having
providing examples in both languages. The functional code
was exactly the same in both languages. On the contrary it
meant we widened the surface of maitainence and thus we are
removing due to the limited benefit provided by the example
chaincode and applications.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-22 21:57:54 +02:00
Sijo Cherian
b4ed9e5afd
Simplify asset-transfer-basic javascript application (#241)
* Improve asset-transfer-basic javascript app code by combining invoke & query.js

Adding a sample application workflow to demonstrate the chaincodes, similar to the WIP PR for basic go-application (https://github.com/hyperledger/fabric-samples/pull/211).
Simplify and document-in-code the app workflow of this sample, in a single app , instead of invoke & query setting up Gateway

Signed-off-by: Sijo Cherian <sijo@ibm.com>

improve javascript app code by combining invoke & query.js

Signed-off-by: Sijo Cherian <sijo@ibm.com>

reverted chaincode func signature

Signed-off-by: Sijo Cherian <sijo@ibm.com>

* create/updateAsset signature in sync with chaincode func change as in #227

Signed-off-by: Sijo Cherian <sijo@ibm.com>

* Tested with latest chaincode, Improved comments

Signed-off-by: Sijo Cherian <sijo@ibm.com>

Co-authored-by: Sijo Cherian <sijo@ibm.com>
2020-07-15 15:21:38 -04:00
Brett Logan
14e9ccf85b Remove QueryResult Type
There was no need for GetAllAssets to return a custom type,
it can simple return an array of all assets.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-15 13:22:56 -04:00
Chris Gabriel
621a2c263e Fix param sequence for typescript invoke function.
Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
2020-07-12 17:29:06 -04:00
Chris Gabriel
e83aecfe0c Fix param sequence for javascript invoke function.
Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
2020-07-12 17:28:43 -04:00
Chris Gabriel
aa3ae32afb Fix param sequence in smartcontract
smartcontract_test.

Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
2020-07-12 12:12:32 -04:00
Brett Logan
426cdf1f98 Add Tests and Mocks To Asset Transfer Chaincode
Many users raise questions on how to test chaincode. It used
to be much easier with the old shim, as they could directly
use the old mock stub in the shim. Now that it no longer exists
the fabcar example can provide an example of how to test chaincode.

Also worth noting is our current directory structure of our Go
chaincodes prevents the creation of mocks due to import cycles.
This change also pushes the chaincode logic down into a `chaincode`
package.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-10 05:59:22 -04:00
Brett Logan
a04db374aa Refactor Chaincode Into Idiomatic Go
Cleans up the code and pushes the smart contract
implementation down into a `chaincode` package.
This is in prep for implementing unit testing in the
chaincode, as you cannot mock code that is part of
the main package.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-10 05:59:22 -04:00
Dereck
1eafa98a6f
Add application-typescript to asset-transfer-basci (#221)
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-07-02 13:43:48 -04:00
Dereck
fd98ec650a
Add filepath check for invoke (#222)
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-07-02 13:36:47 -04:00
Dereck
2f58fb29c4
Adding NodeJS app for asset-transfer-basic sample. (#206)
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-30 15:36:47 -04:00
Chongxin Luo
a42bbba2c5 Adding chaincode-typescript to asset-transfer-basic sample.
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-25 12:06:13 -04:00
Chongxin Luo
bee5f6e07f Adding chaincode-js to asset-transfer-basic
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-25 12:02:53 -04:00
Chongxin Luo
22bcf8cfa4 Fix go mod for chaincode-go
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-25 12:01:45 -04:00
Chongxin Luo
a228b16364 Initialize asset transfer basic sample.
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-09 19:21:24 -04:00