Created
June 16, 2017 16:47
-
-
Save himani1/8e52655d0a637b874f39aeb6f2c7941d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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