Skip to content

Commit

Permalink
Move core/util to common/util
Browse files Browse the repository at this point in the history
As a matter of policy, the only imports a package should have outside of
its base dir are protos/ vendor/ and common/.  The core/util package was
referenced all over the code, so moving it to common seems like the best
option.

Change-Id: Ic7d797be6a1b44634480a361ae7469b794685762
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed Jan 11, 2017
1 parent 65e0675 commit 289b1a2
Show file tree
Hide file tree
Showing 57 changed files with 55 additions and 56 deletions.
2 changes: 1 addition & 1 deletion bddtests/chaincode.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
pb "github.com/hyperledger/fabric/protos/peer"
putils "github.com/hyperledger/fabric/protos/utils"
)
Expand Down
2 changes: 1 addition & 1 deletion bddtests/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/DATA-DOG/godog"
"github.com/DATA-DOG/godog/gherkin"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
)

// BDDContext represents the current context for the executing scenario. Commensurate concept of 'context' from behave testing.
Expand Down
2 changes: 1 addition & 1 deletion bddtests/context_endorser.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (

"github.com/DATA-DOG/godog"
"github.com/DATA-DOG/godog/gherkin"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode/platforms"
"github.com/hyperledger/fabric/core/container"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
"github.com/hyperledger/fabric/protos/utils"
"golang.org/x/net/context"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion core/chaincode/chaincodeexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
pb "github.com/hyperledger/fabric/protos/peer"
)

Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/concurrency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sync"
"testing"

"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
pb "github.com/hyperledger/fabric/protos/peer"

"golang.org/x/net/context"
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/exectransaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import (

"path/filepath"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/container"
"github.com/hyperledger/fabric/core/container/ccintf"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
putils "github.com/hyperledger/fabric/protos/utils"

Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"time"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/common/util"
ccintf "github.com/hyperledger/fabric/core/container/ccintf"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
"github.com/looplab/fsm"
logging "github.com/op/go-logging"
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/lccc.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"strings"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode/shim"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
"github.com/op/go-logging"
"golang.org/x/net/context"
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/platforms/car/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"io/ioutil"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
pb "github.com/hyperledger/fabric/protos/peer"
)

Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/platforms/car/test/car_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"os"
"testing"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/config"
"github.com/hyperledger/fabric/core/container"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
)

Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/platforms/golang/hash.go
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (
"github.com/op/go-logging"
"github.com/spf13/viper"

"github.com/hyperledger/fabric/common/util"
ccutil "github.com/hyperledger/fabric/core/chaincode/platforms/util"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
)

Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/platforms/java/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"strings"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/common/util"
ccutil "github.com/hyperledger/fabric/core/chaincode/platforms/util"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
)

Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/platforms/java/test/java_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"os"
"testing"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/config"
"github.com/hyperledger/fabric/core/container"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
)

Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/platforms/util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"os"
"path/filepath"

"github.com/hyperledger/fabric/common/util"
cutil "github.com/hyperledger/fabric/core/container/util"
"github.com/hyperledger/fabric/core/util"
"github.com/op/go-logging"
)

Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/platforms/util/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
)

// TestHashContentChange changes a random byte in a content and checks for hash change
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/shim/chaincode.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (

"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/comm"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
"github.com/op/go-logging"
"github.com/spf13/viper"
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/sysccapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (

"golang.org/x/net/context"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode/shim"
"github.com/hyperledger/fabric/core/container/inproccontroller"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/util"

"github.com/op/go-logging"
"github.com/spf13/viper"
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/systemchaincode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"testing"
"time"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/system_chaincode/samplesyscc"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
"github.com/spf13/viper"
"golang.org/x/net/context"
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"
"testing"

"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
pb "github.com/hyperledger/fabric/protos/peer"

"github.com/golang/protobuf/proto"
Expand Down
2 changes: 1 addition & 1 deletion core/committer/txvalidator/txvalidator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"testing"

"github.com/golang/protobuf/proto"
util2 "github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/ledger/ledgermgmt"
"github.com/hyperledger/fabric/core/ledger/testutil"
"github.com/hyperledger/fabric/core/ledger/util"
util2 "github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/protos/common"
pb "github.com/hyperledger/fabric/protos/peer"
"github.com/hyperledger/fabric/protos/utils"
Expand Down
2 changes: 1 addition & 1 deletion core/committer/txvalidator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"fmt"

"github.com/golang/protobuf/proto"
coreUtil "github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode"
"github.com/hyperledger/fabric/core/ledger"
ledgerUtil "github.com/hyperledger/fabric/core/ledger/util"
"github.com/hyperledger/fabric/core/peer"
coreUtil "github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/protos/common"
"github.com/hyperledger/fabric/protos/utils"
"github.com/op/go-logging"
Expand Down
2 changes: 1 addition & 1 deletion core/container/ccintf/ccintf.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package ccintf
import (
"encoding/hex"

"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
pb "github.com/hyperledger/fabric/protos/peer"
"golang.org/x/net/context"
)
Expand Down
2 changes: 1 addition & 1 deletion core/container/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"os"
"testing"

"github.com/hyperledger/fabric/common/util"
cutil "github.com/hyperledger/fabric/core/container/util"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
"golang.org/x/net/context"
)
Expand Down
2 changes: 1 addition & 1 deletion core/endorser/endorser.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"github.com/op/go-logging"
"golang.org/x/net/context"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/msp"
"github.com/hyperledger/fabric/protos/common"
pb "github.com/hyperledger/fabric/protos/peer"
Expand Down
2 changes: 1 addition & 1 deletion core/endorser/endorser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
"path/filepath"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode"
"github.com/hyperledger/fabric/core/container"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/peer/msp"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/msp"
pb "github.com/hyperledger/fabric/protos/peer"
pbutils "github.com/hyperledger/fabric/protos/utils"
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/kvledger/example/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/core/ledger"

"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/protos/common"
ptestutils "github.com/hyperledger/fabric/protos/testutils"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ limitations under the License.
package lockbasedtxmgr

import (
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/core/util"
)

// LockBasedQueryExecutor is a query executor used in `LockBasedTxMgr`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package lockbasedtxmgr
import (
"errors"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwset"
"github.com/hyperledger/fabric/core/util"
)

// LockBasedTxSimulator is a transaction simulator used in `LockBasedTxMgr`
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/testutil/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/protos/common"
ptestutils "github.com/hyperledger/fabric/protos/testutils"
)
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/testutil/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"testing"
"time"

"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
"github.com/op/go-logging"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion core/peer/fullflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"fmt"
"os"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/peer/msp"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/msp"
"github.com/hyperledger/fabric/protos/peer"
"github.com/hyperledger/fabric/protos/utils"
Expand Down
2 changes: 1 addition & 1 deletion core/peer/msp/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mspmgmt

import (
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/msp"
"github.com/hyperledger/fabric/protos/common"
mspprotos "github.com/hyperledger/fabric/protos/msp"
Expand Down
2 changes: 1 addition & 1 deletion core/peer/msp/peermsp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mspmgmt
import (
"testing"

"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/msp"
"github.com/hyperledger/fabric/protos/msp/testutils"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (

"os"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode/shim"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/peer/msp"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos/peer"
putils "github.com/hyperledger/fabric/protos/utils"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"fmt"
"os"

"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode/shim"
"github.com/hyperledger/fabric/core/peer/msp"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/msp"
"github.com/hyperledger/fabric/protos/common"
"github.com/hyperledger/fabric/protos/peer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"fmt"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode"
"github.com/hyperledger/fabric/core/chaincode/platforms"
"github.com/hyperledger/fabric/core/config"
"github.com/hyperledger/fabric/core/container"
"github.com/hyperledger/fabric/core/crypto"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos"
"github.com/op/go-logging"
"github.com/spf13/viper"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (
"strings"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode"
"github.com/hyperledger/fabric/core/chaincode/platforms"
"github.com/hyperledger/fabric/core/config"
"github.com/hyperledger/fabric/core/container"
"github.com/hyperledger/fabric/core/crypto"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/core/util"
pb "github.com/hyperledger/fabric/protos"
"github.com/op/go-logging"
"github.com/spf13/viper"
Expand Down
Loading

0 comments on commit 289b1a2

Please sign in to comment.