Commit graph

16 commits

Author SHA1 Message Date
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