Skip to content

Instantly share code, notes, and snippets.

@himani1
Created June 16, 2017 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save himani1/8e52655d0a637b874f39aeb6f2c7941d to your computer and use it in GitHub Desktop.
Save himani1/8e52655d0a637b874f39aeb6f2c7941d to your computer and use it in GitHub Desktop.
func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {
   fmt.Println("invoke is running " + function)
   // Handle different functions
   if function == "init" {
       return t.Init(stub, "init", args)
   } else if function == "write" {
       return t.write(stub, args)
   }
   fmt.Println("invoke did not find func: " + function)
   return nil, errors.New("Received unknown function invocation")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment