title: Why I cannot get my donationId's value from stub's GetState function
body: <p>Currently, I am learning hyperledger/fabric and trying to write the chaincode. Below is the invoke function and customized function I created. </p>
  
  <pre><code>type Donation struct {
      Id string `json:"id"`
      Who string `json:"who"`
      Rid string  `json:"rid"`
      Money int   `json:"money"`
  }
  
  type Request struct {
      Id string `json:"id"`
      Name string  `json:"name"`
      Description string `json:"description"`
      ExpectedMoney int `json:"expectedMoney"`
      CurrentMoney int  `json:"currentMoney"`
      DonationList []string `json:"donationList"`
  }
  
  
  type Person struct {
      Id string `json:"id"`
      Name string `json:"name"`
      MyRequests []string `json:"myRequests"`
      MyDonations []string `json:"myDonations"`
  }
  func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {
  
       if function == "createDonation" {
          return t.createDonation(stub, args)
       }
       return nil, errors.New("Received unknown function invocation")
  }
  func (t *SimpleChaincode) createDonation(stub *shim.ChaincodeStub, args []string) ([]byte, error) {
       var from, toRid string
       var money int
       var err error
  
       if len(args) != 3 {
           return nil, errors.New("My createDonation. Incorrect number of arguments. Expecting 3")
       }
       from = args[0]
       toRid = args[1]
       money, err = strconv.Atoi(args[2])
       if err != nil {
          return nil, errors.New("money cannot convert to number")
       }
  
       var donation Donation
       donation = Donation{Id: "donationid", Rid: toRid, Who: from, Money: money}
       djson, err := json.Marshal(&amp;donation)
       if err != nil {
          return nil, err
       }
       var a = donation.Id
       stub.PutState(a, djson)
  
       personByte, err := stub.GetState(from + "")
       fmt.Println(personByte)
       return nil, nil
  
  }
  
  
  
  func (t *SimpleChaincode) read(stub *shim.ChaincodeStub, args []string) ([]byte, error) {
      log.Println("Get into read function")
  
      var key, jsonResp string
      var err error
  
      key = args[0]
      valAsbytes, err := stub.GetState(key)
      if err != nil {
          jsonResp = "{\"Error\":\"Failed to get state for " + key + "\"}"
          return nil, errors.New(jsonResp)
      }
      if valAsbytes == nil {
          return []byte("cannot find the key's value of the chaincode"), nil
      }
  
      return valAsbytes, nil
  }
  </code></pre>
  
  <p>However, When I tried to use swagger UI to invoke and retrieve the "donationid"'s value, it is empty. Is there anything wrong about my code? Thanks in advance.
  <strong>Invoke</strong></p>
  
  <pre><code>{
      "jsonrpc": "2.0",
      "method": "invoke",
      "params": {
          "type": 1,
          "chaincodeID": {
              "name": "92d975f9301f9b72c7b148e65dcc835a971be55b2555a45c41d6d2eed04ecfd6b1974245cfb77d002e244e9e581e4042747e9f4d6a46b59e9d7e8a7419476296"
          },
          "ctorMsg": {
              "function": "createDonation",
              "args": [
                  "Simon",
                  "requestid",
                  "300"
              ]
          },
          "secureContext": "user_type1_XXXXXXX"
      },
      "id": 3
  }
  </code></pre>
  
  <p>query</p>
  
  <pre><code>{
      "jsonrpc": "2.0",
      "method": "query",
      "params": {
          "type": 1,
          "chaincodeID": {
              "name": "92d975f9301f9b72c7b148e65dcc835a971be55b2555a45c41d6d2eed04ecfd6b1974245cfb77d002e244e9e581e4042747e9f4d6a46b59e9d7e8a7419476296"
          },
          "ctorMsg": {
              "function": "read",
              "args": [
                  "donationid"
              ]
          },
          "secureContext": "user_type1_xxxxxx"
      },
      "id": 2
  }
  </code></pre>