From 537a85c50d450b0ddc73e64d8f0555703744e482 Mon Sep 17 00:00:00 2001 From: Bruno Andreghetti Date: Mon, 21 Jun 2021 11:52:18 -0300 Subject: [PATCH] Add ccToolsVersion to header --- transactions/deleteAsset.go | 3 +-- transactions/getHeader.go | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/transactions/deleteAsset.go b/transactions/deleteAsset.go index de9daa2..c246dbe 100644 --- a/transactions/deleteAsset.go +++ b/transactions/deleteAsset.go @@ -43,14 +43,13 @@ var DeleteAsset = Transaction{ return nil, errors.WrapError(err, "failed to read asset from blockchain") } - response := make([]byte, 0) + var response []byte if cascade { response, err = asset.DeleteCascade(stub) if err != nil { return nil, errors.WrapError(err, "failed to delete asset recursively") } } else { - response, err = asset.Delete(stub) if err != nil { return nil, errors.WrapError(err, "failed to delete asset") diff --git a/transactions/getHeader.go b/transactions/getHeader.go index ad1f285..c09049c 100644 --- a/transactions/getHeader.go +++ b/transactions/getHeader.go @@ -9,16 +9,18 @@ import ( ) type Header struct { - Name string - Version string - Colors map[string][]string - Title map[string]string + Name string + Version string + Colors map[string][]string + Title map[string]string + CCToolsVersion string } var header Header func InitHeader(h Header) { header = h + header.CCToolsVersion = "v0.7.0-rc.3" } // GetHeader returns data in CCHeader @@ -52,11 +54,12 @@ var GetHeader = Transaction{ } header := map[string]interface{}{ - "name": header.Name, - "version": header.Version, - "orgMSP": orgMSP, - "colors": colors, - "orgTitle": orgTitle, + "name": header.Name, + "version": header.Version, + "orgMSP": orgMSP, + "colors": colors, + "orgTitle": orgTitle, + "ccToolsVersion": header.CCToolsVersion, } headerBytes, err := json.Marshal(header) if err != nil {