From 3854f3b69c53f1d4629f46f9c2b9f2c7048559c6 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Thu, 6 Jan 2022 18:35:58 -0500 Subject: [PATCH] more explanation to checktx per review feedback --- docs/tutorials/go-built-in.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/go-built-in.md b/docs/tutorials/go-built-in.md index 001a33202..16c5234b9 100644 --- a/docs/tutorials/go-built-in.md +++ b/docs/tutorials/go-built-in.md @@ -210,7 +210,6 @@ func (app *KVStoreApplication) validateTx(tx []byte) uint32 { } ``` - And call it from within your `CheckTx` method: ```go @@ -221,11 +220,15 @@ func (app *KVStoreApplication) CheckTx(req abcitypes.RequestCheckTx) abcitypes.R ``` Any response with a non-zero code will be considered invalid by Tendermint. -Our `CheckTx` logic returns `0` to Tendermint when the transaction passes -the validation checks. The specific value of the code is meaningless to Tendermint. +Our `CheckTx` logic returns `0` to Tendermint when a transaction passes +its validation checks. The specific value of the code is meaningless to Tendermint. Non-zero codes are logged by Tendermint so applications can provide more specific information on why the transaction was rejected. +Note that `CheckTx` _does not execute_ the transaction, it only verifies that that the +transaction _could_ be executed. We do not know yet if the rest of the network has +agreed to accept this transaction into a block. + Finally, make sure to add the `bytes` package to the your import stanza at the top of `app.go`: