Browse Source

Include 'value' and 'valueHex' fields in dummy query response

pull/1780/head
Matt Bell 8 years ago
parent
commit
ab211d2dbe
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      example/dummy/dummy.go

+ 5
- 4
example/dummy/dummy.go View File

@ -49,12 +49,13 @@ func (app *DummyApplication) Commit() types.Result {
func (app *DummyApplication) Query(query []byte) types.Result {
index, value, exists := app.state.Get(query)
queryResult := QueryResult{index, hex.EncodeToString(value), exists}
queryResult := QueryResult{index, string(value), hex.EncodeToString(value), exists}
return types.NewResultOK(wire.JSONBytes(queryResult), "")
}
type QueryResult struct {
Index int `json:"index"`
Value string `json:"value"`
Exists bool `json:"exists"`
Index int `json:"index"`
Value string `json:"value"`
ValueHex string `json:"valueHex"`
Exists bool `json:"exists"`
}

Loading…
Cancel
Save