From 4e9bc603d1d49644641f1867e5d36afe5f3abfac Mon Sep 17 00:00:00 2001 From: mikaellafs Date: Fri, 27 Oct 2023 16:11:33 -0300 Subject: [PATCH] Remove root param from putRecursive --- assets/put.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/put.go b/assets/put.go index 30a70b7..7e5cb4f 100644 --- a/assets/put.go +++ b/assets/put.go @@ -93,7 +93,7 @@ func (a *Asset) PutNew(stub *sw.StubWrapper) (map[string]interface{}, errors.ICC return res, nil } -func putRecursive(stub *sw.StubWrapper, object map[string]interface{}, root bool) (map[string]interface{}, errors.ICCError) { +func putRecursive(stub *sw.StubWrapper, object map[string]interface{}) (map[string]interface{}, errors.ICCError) { var err error objAsKey, err := NewKey(object) @@ -181,7 +181,7 @@ func putRecursive(stub *sw.StubWrapper, object map[string]interface{}, root bool return nil, errors.NewCCError(fmt.Sprintf("asset reference property '%s' must have an '@assetType' property", subAsset.Tag), 400) } } - putSubAsset, err := putRecursive(stub, obj, false) + putSubAsset, err := putRecursive(stub, obj) if err != nil { return nil, errors.WrapError(err, fmt.Sprintf("failed to put sub-asset %s recursively", subAsset.Tag)) } @@ -218,7 +218,7 @@ func putRecursive(stub *sw.StubWrapper, object map[string]interface{}, root bool // PutRecursive inserts asset and all its subassets in blockchain. // This method is experimental and might not work as intended. Use with caution. func PutRecursive(stub *sw.StubWrapper, object map[string]interface{}) (map[string]interface{}, errors.ICCError) { - return putRecursive(stub, object, true) + return putRecursive(stub, object) } // PutNewRecursive inserts asset and all its subassets in blockchain