You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

365 lines
9.4 KiB

abci: Synchronize FinalizeBlock with the updated specification (#7983) This change set implements the most recent version of `FinalizeBlock`. # What does this change actually contain? * This change set is rather large but fear not! The majority of the files touched and changes are renaming `ResponseDeliverTx` to `ExecTxResult`. This should be a pretty inoffensive change since they're effectively the same type but with a different name. * The `execBlockOnProxyApp` was totally removed since it served as just a wrapper around the logic that is now mostly encapsulated within `FinalizeBlock` * The `updateState` helper function has been made a public method on `State`. It was being exposed as a shim through the testing infrastructure, so this seemed innocuous. * Tests already existed to ensure that the application received the `ByzantineValidators` and the `ValidatorUpdates`, but one was fixed up to ensure that `LastCommitInfo` was being sent across. * Tests were removed from the `psql` indexer that seemed to search for an event in the indexer that was not being created. # Questions for reviewers * We store this [ABCIResponses](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/proto/tendermint/state/types.pb.go#L37) type in the data base as the block results. This type has changed since v0.35 to contain the `FinalizeBlock` response. I'm wondering if we need to do any shimming to keep the old data retrieveable? * Similarly, this change is exposed via the RPC through [ResultBlockResults](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/rpc/coretypes/responses.go#L69) changing. Should we somehow shim or notify for this change? closes: #7658
3 years ago
abci: Synchronize FinalizeBlock with the updated specification (#7983) This change set implements the most recent version of `FinalizeBlock`. # What does this change actually contain? * This change set is rather large but fear not! The majority of the files touched and changes are renaming `ResponseDeliverTx` to `ExecTxResult`. This should be a pretty inoffensive change since they're effectively the same type but with a different name. * The `execBlockOnProxyApp` was totally removed since it served as just a wrapper around the logic that is now mostly encapsulated within `FinalizeBlock` * The `updateState` helper function has been made a public method on `State`. It was being exposed as a shim through the testing infrastructure, so this seemed innocuous. * Tests already existed to ensure that the application received the `ByzantineValidators` and the `ValidatorUpdates`, but one was fixed up to ensure that `LastCommitInfo` was being sent across. * Tests were removed from the `psql` indexer that seemed to search for an event in the indexer that was not being created. # Questions for reviewers * We store this [ABCIResponses](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/proto/tendermint/state/types.pb.go#L37) type in the data base as the block results. This type has changed since v0.35 to contain the `FinalizeBlock` response. I'm wondering if we need to do any shimming to keep the old data retrieveable? * Similarly, this change is exposed via the RPC through [ResultBlockResults](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/rpc/coretypes/responses.go#L69) changing. Should we somehow shim or notify for this change? closes: #7658
3 years ago
lint: Enable Golint (#4212) * Fix many golint errors * Fix golint errors in the 'lite' package * Don't export Pool.store * Fix typo * Revert unwanted changes * Fix errors in counter package * Fix linter errors in kvstore package * Fix linter error in example package * Fix error in tests package * Fix linter errors in v2 package * Fix linter errors in consensus package * Fix linter errors in evidence package * Fix linter error in fail package * Fix linter errors in query package * Fix linter errors in core package * Fix linter errors in node package * Fix linter errors in mempool package * Fix linter error in conn package * Fix linter errors in pex package * Rename PEXReactor export to Reactor * Fix linter errors in trust package * Fix linter errors in upnp package * Fix linter errors in p2p package * Fix linter errors in proxy package * Fix linter errors in mock_test package * Fix linter error in client_test package * Fix linter errors in coretypes package * Fix linter errors in coregrpc package * Fix linter errors in rpcserver package * Fix linter errors in rpctypes package * Fix linter errors in rpctest package * Fix linter error in json2wal script * Fix linter error in wal2json script * Fix linter errors in kv package * Fix linter error in state package * Fix linter error in grpc_client * Fix linter errors in types package * Fix linter error in version package * Fix remaining errors * Address review comments * Fix broken tests * Reconcile package coregrpc * Fix golangci bot error * Fix new golint errors * Fix broken reference * Enable golint linter * minor changes to bring golint into line * fix failing test * fix pex reactor naming * address PR comments
5 years ago
7 years ago
7 years ago
abci: Synchronize FinalizeBlock with the updated specification (#7983) This change set implements the most recent version of `FinalizeBlock`. # What does this change actually contain? * This change set is rather large but fear not! The majority of the files touched and changes are renaming `ResponseDeliverTx` to `ExecTxResult`. This should be a pretty inoffensive change since they're effectively the same type but with a different name. * The `execBlockOnProxyApp` was totally removed since it served as just a wrapper around the logic that is now mostly encapsulated within `FinalizeBlock` * The `updateState` helper function has been made a public method on `State`. It was being exposed as a shim through the testing infrastructure, so this seemed innocuous. * Tests already existed to ensure that the application received the `ByzantineValidators` and the `ValidatorUpdates`, but one was fixed up to ensure that `LastCommitInfo` was being sent across. * Tests were removed from the `psql` indexer that seemed to search for an event in the indexer that was not being created. # Questions for reviewers * We store this [ABCIResponses](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/proto/tendermint/state/types.pb.go#L37) type in the data base as the block results. This type has changed since v0.35 to contain the `FinalizeBlock` response. I'm wondering if we need to do any shimming to keep the old data retrieveable? * Similarly, this change is exposed via the RPC through [ResultBlockResults](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/rpc/coretypes/responses.go#L69) changing. Should we somehow shim or notify for this change? closes: #7658
3 years ago
7 years ago
8 years ago
lint: Enable Golint (#4212) * Fix many golint errors * Fix golint errors in the 'lite' package * Don't export Pool.store * Fix typo * Revert unwanted changes * Fix errors in counter package * Fix linter errors in kvstore package * Fix linter error in example package * Fix error in tests package * Fix linter errors in v2 package * Fix linter errors in consensus package * Fix linter errors in evidence package * Fix linter error in fail package * Fix linter errors in query package * Fix linter errors in core package * Fix linter errors in node package * Fix linter errors in mempool package * Fix linter error in conn package * Fix linter errors in pex package * Rename PEXReactor export to Reactor * Fix linter errors in trust package * Fix linter errors in upnp package * Fix linter errors in p2p package * Fix linter errors in proxy package * Fix linter errors in mock_test package * Fix linter error in client_test package * Fix linter errors in coretypes package * Fix linter errors in coregrpc package * Fix linter errors in rpcserver package * Fix linter errors in rpctypes package * Fix linter errors in rpctest package * Fix linter error in json2wal script * Fix linter error in wal2json script * Fix linter errors in kv package * Fix linter error in state package * Fix linter error in grpc_client * Fix linter errors in types package * Fix linter error in version package * Fix remaining errors * Address review comments * Fix broken tests * Reconcile package coregrpc * Fix golangci bot error * Fix new golint errors * Fix broken reference * Enable golint linter * minor changes to bring golint into line * fix failing test * fix pex reactor naming * address PR comments
5 years ago
lint: Enable Golint (#4212) * Fix many golint errors * Fix golint errors in the 'lite' package * Don't export Pool.store * Fix typo * Revert unwanted changes * Fix errors in counter package * Fix linter errors in kvstore package * Fix linter error in example package * Fix error in tests package * Fix linter errors in v2 package * Fix linter errors in consensus package * Fix linter errors in evidence package * Fix linter error in fail package * Fix linter errors in query package * Fix linter errors in core package * Fix linter errors in node package * Fix linter errors in mempool package * Fix linter error in conn package * Fix linter errors in pex package * Rename PEXReactor export to Reactor * Fix linter errors in trust package * Fix linter errors in upnp package * Fix linter errors in p2p package * Fix linter errors in proxy package * Fix linter errors in mock_test package * Fix linter error in client_test package * Fix linter errors in coretypes package * Fix linter errors in coregrpc package * Fix linter errors in rpcserver package * Fix linter errors in rpctypes package * Fix linter errors in rpctest package * Fix linter error in json2wal script * Fix linter error in wal2json script * Fix linter errors in kv package * Fix linter error in state package * Fix linter error in grpc_client * Fix linter errors in types package * Fix linter error in version package * Fix remaining errors * Address review comments * Fix broken tests * Reconcile package coregrpc * Fix golangci bot error * Fix new golint errors * Fix broken reference * Enable golint linter * minor changes to bring golint into line * fix failing test * fix pex reactor naming * address PR comments
5 years ago
abci: Synchronize FinalizeBlock with the updated specification (#7983) This change set implements the most recent version of `FinalizeBlock`. # What does this change actually contain? * This change set is rather large but fear not! The majority of the files touched and changes are renaming `ResponseDeliverTx` to `ExecTxResult`. This should be a pretty inoffensive change since they're effectively the same type but with a different name. * The `execBlockOnProxyApp` was totally removed since it served as just a wrapper around the logic that is now mostly encapsulated within `FinalizeBlock` * The `updateState` helper function has been made a public method on `State`. It was being exposed as a shim through the testing infrastructure, so this seemed innocuous. * Tests already existed to ensure that the application received the `ByzantineValidators` and the `ValidatorUpdates`, but one was fixed up to ensure that `LastCommitInfo` was being sent across. * Tests were removed from the `psql` indexer that seemed to search for an event in the indexer that was not being created. # Questions for reviewers * We store this [ABCIResponses](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/proto/tendermint/state/types.pb.go#L37) type in the data base as the block results. This type has changed since v0.35 to contain the `FinalizeBlock` response. I'm wondering if we need to do any shimming to keep the old data retrieveable? * Similarly, this change is exposed via the RPC through [ResultBlockResults](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/rpc/coretypes/responses.go#L69) changing. Should we somehow shim or notify for this change? closes: #7658
3 years ago
abci: Synchronize FinalizeBlock with the updated specification (#7983) This change set implements the most recent version of `FinalizeBlock`. # What does this change actually contain? * This change set is rather large but fear not! The majority of the files touched and changes are renaming `ResponseDeliverTx` to `ExecTxResult`. This should be a pretty inoffensive change since they're effectively the same type but with a different name. * The `execBlockOnProxyApp` was totally removed since it served as just a wrapper around the logic that is now mostly encapsulated within `FinalizeBlock` * The `updateState` helper function has been made a public method on `State`. It was being exposed as a shim through the testing infrastructure, so this seemed innocuous. * Tests already existed to ensure that the application received the `ByzantineValidators` and the `ValidatorUpdates`, but one was fixed up to ensure that `LastCommitInfo` was being sent across. * Tests were removed from the `psql` indexer that seemed to search for an event in the indexer that was not being created. # Questions for reviewers * We store this [ABCIResponses](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/proto/tendermint/state/types.pb.go#L37) type in the data base as the block results. This type has changed since v0.35 to contain the `FinalizeBlock` response. I'm wondering if we need to do any shimming to keep the old data retrieveable? * Similarly, this change is exposed via the RPC through [ResultBlockResults](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/rpc/coretypes/responses.go#L69) changing. Should we somehow shim or notify for this change? closes: #7658
3 years ago
  1. package kvstore
  2. import (
  3. "context"
  4. "fmt"
  5. "sort"
  6. "testing"
  7. "github.com/fortytw2/leaktest"
  8. "github.com/stretchr/testify/require"
  9. "github.com/tendermint/tendermint/libs/log"
  10. "github.com/tendermint/tendermint/libs/service"
  11. abciclient "github.com/tendermint/tendermint/abci/client"
  12. "github.com/tendermint/tendermint/abci/example/code"
  13. abciserver "github.com/tendermint/tendermint/abci/server"
  14. "github.com/tendermint/tendermint/abci/types"
  15. tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
  16. )
  17. const (
  18. testKey = "abc"
  19. testValue = "def"
  20. )
  21. func testKVStore(t *testing.T, app types.Application, tx []byte, key, value string) {
  22. req := types.RequestFinalizeBlock{Txs: [][]byte{tx}}
  23. ar := app.FinalizeBlock(req)
  24. require.Equal(t, 1, len(ar.TxResults))
  25. require.False(t, ar.TxResults[0].IsErr())
  26. // repeating tx doesn't raise error
  27. ar = app.FinalizeBlock(req)
  28. require.Equal(t, 1, len(ar.TxResults))
  29. require.False(t, ar.TxResults[0].IsErr())
  30. // commit
  31. app.Commit()
  32. info := app.Info(types.RequestInfo{})
  33. require.NotZero(t, info.LastBlockHeight)
  34. // make sure query is fine
  35. resQuery := app.Query(types.RequestQuery{
  36. Path: "/store",
  37. Data: []byte(key),
  38. })
  39. require.Equal(t, code.CodeTypeOK, resQuery.Code)
  40. require.Equal(t, key, string(resQuery.Key))
  41. require.Equal(t, value, string(resQuery.Value))
  42. require.EqualValues(t, info.LastBlockHeight, resQuery.Height)
  43. // make sure proof is fine
  44. resQuery = app.Query(types.RequestQuery{
  45. Path: "/store",
  46. Data: []byte(key),
  47. Prove: true,
  48. })
  49. require.EqualValues(t, code.CodeTypeOK, resQuery.Code)
  50. require.Equal(t, key, string(resQuery.Key))
  51. require.Equal(t, value, string(resQuery.Value))
  52. require.EqualValues(t, info.LastBlockHeight, resQuery.Height)
  53. }
  54. func TestKVStoreKV(t *testing.T) {
  55. kvstore := NewApplication()
  56. key := testKey
  57. value := key
  58. tx := []byte(key)
  59. testKVStore(t, kvstore, tx, key, value)
  60. value = testValue
  61. tx = []byte(key + "=" + value)
  62. testKVStore(t, kvstore, tx, key, value)
  63. }
  64. func TestPersistentKVStoreKV(t *testing.T) {
  65. dir := t.TempDir()
  66. logger := log.NewNopLogger()
  67. kvstore := NewPersistentKVStoreApplication(logger, dir)
  68. key := testKey
  69. value := key
  70. tx := []byte(key)
  71. testKVStore(t, kvstore, tx, key, value)
  72. value = testValue
  73. tx = []byte(key + "=" + value)
  74. testKVStore(t, kvstore, tx, key, value)
  75. }
  76. func TestPersistentKVStoreInfo(t *testing.T) {
  77. dir := t.TempDir()
  78. logger := log.NewNopLogger()
  79. kvstore := NewPersistentKVStoreApplication(logger, dir)
  80. InitKVStore(kvstore)
  81. height := int64(0)
  82. resInfo := kvstore.Info(types.RequestInfo{})
  83. if resInfo.LastBlockHeight != height {
  84. t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight)
  85. }
  86. // make and apply block
  87. height = int64(1)
  88. hash := []byte("foo")
  89. header := tmproto.Header{
  90. Height: height,
  91. }
  92. kvstore.FinalizeBlock(types.RequestFinalizeBlock{Hash: hash, Header: header})
  93. kvstore.Commit()
  94. resInfo = kvstore.Info(types.RequestInfo{})
  95. if resInfo.LastBlockHeight != height {
  96. t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight)
  97. }
  98. }
  99. // add a validator, remove a validator, update a validator
  100. func TestValUpdates(t *testing.T) {
  101. kvstore := NewApplication()
  102. // init with some validators
  103. total := 10
  104. nInit := 5
  105. vals := RandVals(total)
  106. // initialize with the first nInit
  107. kvstore.InitChain(types.RequestInitChain{
  108. Validators: vals[:nInit],
  109. })
  110. vals1, vals2 := vals[:nInit], kvstore.Validators()
  111. valsEqual(t, vals1, vals2)
  112. var v1, v2, v3 types.ValidatorUpdate
  113. // add some validators
  114. v1, v2 = vals[nInit], vals[nInit+1]
  115. diff := []types.ValidatorUpdate{v1, v2}
  116. tx1 := MakeValSetChangeTx(v1.PubKey, v1.Power)
  117. tx2 := MakeValSetChangeTx(v2.PubKey, v2.Power)
  118. makeApplyBlock(t, kvstore, 1, diff, tx1, tx2)
  119. vals1, vals2 = vals[:nInit+2], kvstore.Validators()
  120. valsEqual(t, vals1, vals2)
  121. // remove some validators
  122. v1, v2, v3 = vals[nInit-2], vals[nInit-1], vals[nInit]
  123. v1.Power = 0
  124. v2.Power = 0
  125. v3.Power = 0
  126. diff = []types.ValidatorUpdate{v1, v2, v3}
  127. tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power)
  128. tx2 = MakeValSetChangeTx(v2.PubKey, v2.Power)
  129. tx3 := MakeValSetChangeTx(v3.PubKey, v3.Power)
  130. makeApplyBlock(t, kvstore, 2, diff, tx1, tx2, tx3)
  131. vals1 = append(vals[:nInit-2], vals[nInit+1]) // nolint: gocritic
  132. vals2 = kvstore.Validators()
  133. valsEqual(t, vals1, vals2)
  134. // update some validators
  135. v1 = vals[0]
  136. if v1.Power == 5 {
  137. v1.Power = 6
  138. } else {
  139. v1.Power = 5
  140. }
  141. diff = []types.ValidatorUpdate{v1}
  142. tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power)
  143. makeApplyBlock(t, kvstore, 3, diff, tx1)
  144. vals1 = append([]types.ValidatorUpdate{v1}, vals1[1:]...)
  145. vals2 = kvstore.Validators()
  146. valsEqual(t, vals1, vals2)
  147. }
  148. func makeApplyBlock(
  149. t *testing.T,
  150. kvstore types.Application,
  151. heightInt int,
  152. diff []types.ValidatorUpdate,
  153. txs ...[]byte) {
  154. // make and apply block
  155. height := int64(heightInt)
  156. hash := []byte("foo")
  157. header := tmproto.Header{
  158. Height: height,
  159. }
  160. resFinalizeBlock := kvstore.FinalizeBlock(types.RequestFinalizeBlock{
  161. Hash: hash,
  162. Header: header,
  163. Txs: txs,
  164. })
  165. kvstore.Commit()
  166. valsEqual(t, diff, resFinalizeBlock.ValidatorUpdates)
  167. }
  168. // order doesn't matter
  169. func valsEqual(t *testing.T, vals1, vals2 []types.ValidatorUpdate) {
  170. t.Helper()
  171. if len(vals1) != len(vals2) {
  172. t.Fatalf("vals dont match in len. got %d, expected %d", len(vals2), len(vals1))
  173. }
  174. sort.Sort(types.ValidatorUpdates(vals1))
  175. sort.Sort(types.ValidatorUpdates(vals2))
  176. for i, v1 := range vals1 {
  177. v2 := vals2[i]
  178. if !v1.PubKey.Equal(v2.PubKey) ||
  179. v1.Power != v2.Power {
  180. t.Fatalf("vals dont match at index %d. got %X/%d , expected %X/%d", i, v2.PubKey, v2.Power, v1.PubKey, v1.Power)
  181. }
  182. }
  183. }
  184. func makeSocketClientServer(
  185. ctx context.Context,
  186. t *testing.T,
  187. logger log.Logger,
  188. app types.Application,
  189. name string,
  190. ) (abciclient.Client, service.Service, error) {
  191. t.Helper()
  192. ctx, cancel := context.WithCancel(ctx)
  193. t.Cleanup(cancel)
  194. t.Cleanup(leaktest.Check(t))
  195. // Start the listener
  196. socket := fmt.Sprintf("unix://%s.sock", name)
  197. server := abciserver.NewSocketServer(logger.With("module", "abci-server"), socket, app)
  198. if err := server.Start(ctx); err != nil {
  199. cancel()
  200. return nil, nil, err
  201. }
  202. // Connect to the socket
  203. client := abciclient.NewSocketClient(logger.With("module", "abci-client"), socket, false)
  204. if err := client.Start(ctx); err != nil {
  205. cancel()
  206. return nil, nil, err
  207. }
  208. return client, server, nil
  209. }
  210. func makeGRPCClientServer(
  211. ctx context.Context,
  212. t *testing.T,
  213. logger log.Logger,
  214. app types.Application,
  215. name string,
  216. ) (abciclient.Client, service.Service, error) {
  217. ctx, cancel := context.WithCancel(ctx)
  218. t.Cleanup(cancel)
  219. t.Cleanup(leaktest.Check(t))
  220. // Start the listener
  221. socket := fmt.Sprintf("unix://%s.sock", name)
  222. gapp := types.NewGRPCApplication(app)
  223. server := abciserver.NewGRPCServer(logger.With("module", "abci-server"), socket, gapp)
  224. if err := server.Start(ctx); err != nil {
  225. cancel()
  226. return nil, nil, err
  227. }
  228. client := abciclient.NewGRPCClient(logger.With("module", "abci-client"), socket, true)
  229. if err := client.Start(ctx); err != nil {
  230. cancel()
  231. return nil, nil, err
  232. }
  233. return client, server, nil
  234. }
  235. func TestClientServer(t *testing.T) {
  236. ctx, cancel := context.WithCancel(context.Background())
  237. defer cancel()
  238. logger := log.NewNopLogger()
  239. // set up socket app
  240. kvstore := NewApplication()
  241. client, server, err := makeSocketClientServer(ctx, t, logger, kvstore, "kvstore-socket")
  242. require.NoError(t, err)
  243. t.Cleanup(func() { cancel(); server.Wait() })
  244. t.Cleanup(func() { cancel(); client.Wait() })
  245. runClientTests(ctx, t, client)
  246. // set up grpc app
  247. kvstore = NewApplication()
  248. gclient, gserver, err := makeGRPCClientServer(ctx, t, logger, kvstore, "/tmp/kvstore-grpc")
  249. require.NoError(t, err)
  250. t.Cleanup(func() { cancel(); gserver.Wait() })
  251. t.Cleanup(func() { cancel(); gclient.Wait() })
  252. runClientTests(ctx, t, gclient)
  253. }
  254. func runClientTests(ctx context.Context, t *testing.T, client abciclient.Client) {
  255. // run some tests....
  256. key := testKey
  257. value := key
  258. tx := []byte(key)
  259. testClient(ctx, t, client, tx, key, value)
  260. value = testValue
  261. tx = []byte(key + "=" + value)
  262. testClient(ctx, t, client, tx, key, value)
  263. }
  264. func testClient(ctx context.Context, t *testing.T, app abciclient.Client, tx []byte, key, value string) {
  265. ar, err := app.FinalizeBlock(ctx, types.RequestFinalizeBlock{Txs: [][]byte{tx}})
  266. require.NoError(t, err)
  267. require.Equal(t, 1, len(ar.TxResults))
  268. require.False(t, ar.TxResults[0].IsErr())
  269. // repeating FinalizeBlock doesn't raise error
  270. ar, err = app.FinalizeBlock(ctx, types.RequestFinalizeBlock{Txs: [][]byte{tx}})
  271. require.NoError(t, err)
  272. require.Equal(t, 1, len(ar.TxResults))
  273. require.False(t, ar.TxResults[0].IsErr())
  274. // commit
  275. _, err = app.Commit(ctx)
  276. require.NoError(t, err)
  277. info, err := app.Info(ctx, types.RequestInfo{})
  278. require.NoError(t, err)
  279. require.NotZero(t, info.LastBlockHeight)
  280. // make sure query is fine
  281. resQuery, err := app.Query(ctx, types.RequestQuery{
  282. Path: "/store",
  283. Data: []byte(key),
  284. })
  285. require.NoError(t, err)
  286. require.Equal(t, code.CodeTypeOK, resQuery.Code)
  287. require.Equal(t, key, string(resQuery.Key))
  288. require.Equal(t, value, string(resQuery.Value))
  289. require.EqualValues(t, info.LastBlockHeight, resQuery.Height)
  290. // make sure proof is fine
  291. resQuery, err = app.Query(ctx, types.RequestQuery{
  292. Path: "/store",
  293. Data: []byte(key),
  294. Prove: true,
  295. })
  296. require.NoError(t, err)
  297. require.Equal(t, code.CodeTypeOK, resQuery.Code)
  298. require.Equal(t, key, string(resQuery.Key))
  299. require.Equal(t, value, string(resQuery.Value))
  300. require.EqualValues(t, info.LastBlockHeight, resQuery.Height)
  301. }