mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-31 13:16:59 +00:00
Begin adding proof calls
This commit is contained in:
@@ -61,6 +61,10 @@ func (app *ChainAwareApplication) Query(query []byte) types.Result {
|
||||
return types.NewResultOK([]byte(Fmt("%d,%d", app.beginCount, app.endCount)), "")
|
||||
}
|
||||
|
||||
func (app *ChainAwareApplication) Proof(key []byte) types.Result {
|
||||
return types.NewResultOK(nil, Fmt("Proof is not supported"))
|
||||
}
|
||||
|
||||
func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) {
|
||||
app.beginCount += 1
|
||||
return
|
||||
|
||||
@@ -83,3 +83,7 @@ func (app *CounterApplication) Query(query []byte) types.Result {
|
||||
|
||||
return types.ErrUnknownRequest.SetLog(Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr))
|
||||
}
|
||||
|
||||
func (app *CounterApplication) Proof(key []byte) types.Result {
|
||||
return types.NewResultOK(nil, Fmt("Proof is not supported"))
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ func (app *DummyApplication) Query(query []byte) types.Result {
|
||||
return types.NewResultOK(wire.JSONBytes(queryResult), "")
|
||||
}
|
||||
|
||||
func (app *DummyApplication) Proof(key []byte) types.Result {
|
||||
return types.NewResultOK(nil, Fmt("TODO: support proof!"))
|
||||
}
|
||||
|
||||
type QueryResult struct {
|
||||
Index int `json:"index"`
|
||||
Value string `json:"value"`
|
||||
|
||||
@@ -93,6 +93,10 @@ func (app *PersistentDummyApplication) Query(query []byte) types.Result {
|
||||
return app.app.Query(query)
|
||||
}
|
||||
|
||||
func (app *PersistentDummyApplication) Proof(key []byte) types.Result {
|
||||
return types.NewResultOK(nil, Fmt("TODO: support proof!"))
|
||||
}
|
||||
|
||||
// Save the validators in the merkle tree
|
||||
func (app *PersistentDummyApplication) InitChain(validators []*types.Validator) {
|
||||
for _, v := range validators {
|
||||
|
||||
@@ -34,3 +34,7 @@ func (app *NilApplication) Commit() types.Result {
|
||||
func (app *NilApplication) Query(query []byte) types.Result {
|
||||
return types.NewResultOK(nil, "")
|
||||
}
|
||||
|
||||
func (app *NilApplication) Proof(key []byte) types.Result {
|
||||
return types.NewResultOK(nil, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user