rpc: add application info to status call (#7701)

* rpc/coretypes: add `ApplicationInfo` to `ResultStatus`
* internal/rpc/core: return application version

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
This commit is contained in:
mempirate
2022-01-27 07:24:01 -08:00
committed by GitHub
co-authored by William Banfield M. J. Fromberger
parent 04bcfecce2
commit db3044ff3c
3 changed files with 14 additions and 1 deletions
+8 -1
View File
@@ -3,6 +3,7 @@ package core
import (
"bytes"
"context"
"fmt"
"time"
tmbytes "github.com/tendermint/tendermint/libs/bytes"
@@ -59,8 +60,14 @@ func (env *Environment) Status(ctx context.Context) (*coretypes.ResultStatus, er
}
}
var applicationInfo coretypes.ApplicationInfo
if abciInfo, err := env.ABCIInfo(ctx); err == nil {
applicationInfo.Version = fmt.Sprint(abciInfo.Response.AppVersion)
}
result := &coretypes.ResultStatus{
NodeInfo: env.P2PTransport.NodeInfo(),
NodeInfo: env.P2PTransport.NodeInfo(),
ApplicationInfo: applicationInfo,
SyncInfo: coretypes.SyncInfo{
LatestBlockHash: latestBlockHash,
LatestAppHash: latestAppHash,