github.com/kchristidis/fabric@v1.0.4-0.20171028114726-837acd08cde1/test/chaincodes/AutoVendor/chaincode/main.go (about)

     1  /*
     2   * Copyright Greg Haskins All Rights Reserved
     3   *
     4   * SPDX-License-Identifier: Apache-2.0
     5   *
     6   * The purpose of this test code is to prove that the system properly packages
     7   * up dependencies.  We therefore synthesize the scenario where a chaincode
     8   * imports non-standard dependencies both directly and indirectly and then
     9   * expect a unit-test to verify that the package includes everything needed
    10   * and ultimately builds properly.
    11   *
    12   */
    13  
    14  package main
    15  
    16  import (
    17  	"fmt"
    18  
    19  	"github.com/hyperledger/fabric/core/chaincode/shim"
    20  	pb "github.com/hyperledger/fabric/protos/peer"
    21  	"github.com/hyperledger/fabric/test/chaincodes/AutoVendor/directdep"
    22  )
    23  
    24  // SimpleChaincode example simple Chaincode implementation
    25  type SimpleChaincode struct {
    26  }
    27  
    28  func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response {
    29  	return shim.Error("NOT IMPL")
    30  }
    31  
    32  func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
    33  	return shim.Error("NOT IMPL")
    34  }
    35  
    36  func main() {
    37  	directdep.PointlessFunction()
    38  
    39  	err := shim.Start(new(SimpleChaincode))
    40  	if err != nil {
    41  		fmt.Printf("Error starting Simple chaincode: %s", err)
    42  	}
    43  }