Skip to content

Commit

Permalink
asset.go
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroAssis authored and bandreghetti committed Mar 26, 2021
1 parent 913f0a6 commit a32c547
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions assets/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import (
"github.com/hyperledger/fabric/core/chaincode/shim"
)

/*
Asset implements the json.Unmarshaler interface
*/
// Asset implements the json.Unmarshaler interface and is the base object in cc-tools network.
// It is a generic map that stores information about a specific ledger asset. It is also used
// as the base interface to perform operations on the blockchain.
type Asset map[string]interface{}

/*
UnmarshalJSON parses JSON-encoded data and returns
*/
//UnmarshalJSON parses JSON-encoded data and returns
func (a *Asset) UnmarshalJSON(jsonData []byte) error {
var err error

Expand All @@ -36,6 +34,7 @@ func (a *Asset) UnmarshalJSON(jsonData []byte) error {
}

// NewAsset constructs Asset object
// Receives a map containing the asset data
func NewAsset(m map[string]interface{}) (a Asset, err errors.ICCError) {
if m == nil {
err = errors.NewCCError("cannot create asset from nil map", 500)
Expand Down

0 comments on commit a32c547

Please sign in to comment.