Skip to content

Commit

Permalink
Merge branch 'develop' into feature/asset-datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
andremacedopv committed Sep 25, 2023
2 parents c8e1362 + 1b51d7c commit b60ed6b
Show file tree
Hide file tree
Showing 79 changed files with 152 additions and 152 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
run: go build -v ./...

- name: Test
run: go test github.com/goledgerdev/cc-tools/test -coverpkg=./... -v
run: go test github.com/hyperledger-labs/cc-tools/test -coverpkg=./... -v
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# GoLedger CC Tools

[![Go Report Card](https://goreportcard.com/badge/github.com/goledgerdev/cc-tools)](https://goreportcard.com/report/github.com/goledgerdev/cc-tools)
[![GoDoc](https://godoc.org/github.com/goledgerdev/cc-tools?status.svg)](https://godoc.org/github.com/goledgerdev/cc-tools)
[![Go Report Card](https://goreportcard.com/badge/github.com/hyperledger-labs/cc-tools)](https://goreportcard.com/report/github.com/hyperledger-labs/cc-tools)
[![GoDoc](https://godoc.org/github.com/hyperledger-labs/cc-tools?status.svg)](https://godoc.org/github.com/hyperledger-labs/cc-tools)

This project is a GoLedger open-source project aimed at providing tools for Hyperledger Fabric chaincode development in Golang. This might have breaking changes before we arrive at release v1.0.0.

## Getting Started

Make sure you visit the repository [goledgerdev/cc-tools-demo](https://github.com/goledgerdev/cc-tools-demo), which is a template of a functional chaincode that uses cc-tools and provides ready-to-use scripts to deploy development networks. This is our preferred way of working, but you can feel free to import the package and assemble the chaincode as you choose.
Make sure you visit the repository [hyperledger-labs/cc-tools-demo](https://github.com/hyperledger-labs/cc-tools-demo), which is a template of a functional chaincode that uses cc-tools and provides ready-to-use scripts to deploy development networks. This is our preferred way of working, but you can feel free to import the package and assemble the chaincode as you choose.

CC Tools has been tested with Hyperledger Fabric 1.x and 2.x realeases.

Expand Down
4 changes: 2 additions & 2 deletions assets/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"time"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

// Asset implements the json.Unmarshaler interface and is the base object in cc-tools network.
Expand Down
4 changes: 2 additions & 2 deletions assets/assetListFuncs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"
"time"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

// AssetTypeList returns a copy of the assetTypeList variable.
Expand Down
4 changes: 2 additions & 2 deletions assets/checkWriters.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"regexp"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

// CheckWriters checks if tx creator is allowed to write asset.
Expand Down
2 changes: 1 addition & 1 deletion assets/dataType.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/goledgerdev/cc-tools/errors"
"github.com/hyperledger-labs/cc-tools/errors"
)

// DataType is the struct defining a primitive data type.
Expand Down
4 changes: 2 additions & 2 deletions assets/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"strings"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

func (a *Asset) delete(stub *sw.StubWrapper) ([]byte, errors.ICCError) {
Expand Down
2 changes: 1 addition & 1 deletion assets/dynamicAssetTypeFuncs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"strings"

"github.com/goledgerdev/cc-tools/errors"
"github.com/hyperledger-labs/cc-tools/errors"
)

// BuildAssetProp builds an AssetProp from an object with the required fields
Expand Down
6 changes: 3 additions & 3 deletions assets/existsInLedger.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package assets

import (
"github.com/goledgerdev/cc-tools/errors"
"github.com/goledgerdev/cc-tools/mock"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
"github.com/hyperledger-labs/cc-tools/mock"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

func existsInLedger(stub *sw.StubWrapper, isPrivate bool, typeTag, key string) (bool, errors.ICCError) {
Expand Down
2 changes: 1 addition & 1 deletion assets/generateKey.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strings"

"github.com/goledgerdev/cc-tools/errors"
"github.com/google/uuid"
"github.com/hyperledger-labs/cc-tools/errors"
)

// GenerateKey implements the logic to generate an asset's unique key. It validates
Expand Down
4 changes: 2 additions & 2 deletions assets/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package assets
import (
"encoding/json"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

func get(stub *sw.StubWrapper, pvtCollection, key string, committed bool) (*Asset, errors.ICCError) {
Expand Down
4 changes: 2 additions & 2 deletions assets/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"net/http"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
"github.com/hyperledger/fabric-chaincode-go/shim"
pb "github.com/hyperledger/fabric-protos-go/peer"
)
Expand Down
2 changes: 1 addition & 1 deletion assets/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"strings"

"github.com/goledgerdev/cc-tools/errors"
"github.com/hyperledger-labs/cc-tools/errors"
)

// Key stores the information for retrieving an Asset from the ledger.
Expand Down
4 changes: 2 additions & 2 deletions assets/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"strings"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

// put writes the reference index to the ledger, then encodes the
Expand Down
4 changes: 2 additions & 2 deletions assets/references.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"strings"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

// Refs returns an array of Keys containing the reference keys for all present subAssets.
Expand Down
4 changes: 2 additions & 2 deletions assets/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package assets
import (
"encoding/json"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
"github.com/hyperledger/fabric-chaincode-go/shim"
pb "github.com/hyperledger/fabric-protos-go/peer"
)
Expand Down
2 changes: 1 addition & 1 deletion assets/setProp.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package assets
import (
"fmt"

"github.com/goledgerdev/cc-tools/errors"
"github.com/hyperledger-labs/cc-tools/errors"
)

// SetProp sets the prop value with proper validation. It does not update the asset in the ledger.
Expand Down
2 changes: 1 addition & 1 deletion assets/startupCheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"regexp"
"strings"

"github.com/goledgerdev/cc-tools/errors"
"github.com/hyperledger-labs/cc-tools/errors"
)

// StartupCheck verifies if asset definitions are properly coded, returning an error if they're not
Expand Down
4 changes: 2 additions & 2 deletions assets/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"regexp"
"strings"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

// Update receives a map[string]interface{} with key/vals to update the asset value in the world state.
Expand Down
2 changes: 1 addition & 1 deletion assets/validateProp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"strings"

"github.com/goledgerdev/cc-tools/errors"
"github.com/hyperledger-labs/cc-tools/errors"
)

// validateProp checks if a given assetProp is valid according to the given property definition
Expand Down
2 changes: 1 addition & 1 deletion assets/validateProps.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/goledgerdev/cc-tools/errors"
"github.com/hyperledger-labs/cc-tools/errors"
)

// ValidateProps checks if all props are compliant to format
Expand Down
4 changes: 2 additions & 2 deletions events/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"net/http"

"github.com/goledgerdev/cc-tools/errors"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/errors"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

type EventType float64
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/goledgerdev/cc-tools
module github.com/hyperledger-labs/cc-tools

go 1.14

Expand Down
4 changes: 2 additions & 2 deletions stubwrapper/stubWrapper.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package stubwrapper

import (
"github.com/goledgerdev/cc-tools/errors"
"github.com/goledgerdev/cc-tools/mock"
"github.com/hyperledger-labs/cc-tools/errors"
"github.com/hyperledger-labs/cc-tools/mock"
"github.com/hyperledger/fabric-chaincode-go/pkg/cid"
"github.com/hyperledger/fabric-chaincode-go/shim"
pb "github.com/hyperledger/fabric-protos-go/peer"
Expand Down
2 changes: 1 addition & 1 deletion test/assets_assetProp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/assets"
)

func TestAssetPropToMap(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/assets_assetType_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/assets"
)

func TestGetPropDef(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/assets_asset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/assets"
)

func TestAssetUnmarshal(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions test/assets_checkWriters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"log"
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/goledgerdev/cc-tools/mock"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/mock"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

func TestCheckWriters(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions test/assets_committedInLedger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package test
import (
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/goledgerdev/cc-tools/mock"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/mock"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

func TestCommittedInLedgerNoKey(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/assets_dataType_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"reflect"
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/assets"
)

func testParseValid(t *testing.T, dtype assets.DataType, inputVal interface{}, expectedKey string, expectedVal interface{}) {
Expand Down
6 changes: 3 additions & 3 deletions test/assets_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"log"
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/goledgerdev/cc-tools/mock"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/mock"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

func TestDeleteWithRef(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/assets_dynamicAssetType_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/assets"
)

func TestBuildAssetPropValid(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/assets_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/goledgerdev/cc-tools/events"
"github.com/hyperledger-labs/cc-tools/events"
)

func TestFetchEvent(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions test/assets_existsInLedger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package test
import (
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/goledgerdev/cc-tools/mock"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/mock"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

func TestExistsInLedgerNoKey(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions test/assets_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"reflect"
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/goledgerdev/cc-tools/mock"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/mock"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

func TestGetAsset(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/assets_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/goledgerdev/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/assets"
)

func TestKeyString(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions test/assets_put_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"testing"
"time"

"github.com/goledgerdev/cc-tools/assets"
"github.com/goledgerdev/cc-tools/mock"
sw "github.com/goledgerdev/cc-tools/stubwrapper"
"github.com/hyperledger-labs/cc-tools/assets"
"github.com/hyperledger-labs/cc-tools/mock"
sw "github.com/hyperledger-labs/cc-tools/stubwrapper"
)

func TestPutAsset(t *testing.T) {
Expand Down
Loading

0 comments on commit b60ed6b

Please sign in to comment.