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.
 
 
 
 
 
 

48 lines
1.2 KiB

package main
import (
"fmt"
"os"
"github.com/tendermint/abci/types"
)
var abciType string
func init() {
abciType = os.Getenv("ABCI")
if abciType == "" {
abciType = "socket"
}
}
func main() {
testCounter()
}
func testCounter() {
abciApp := os.Getenv("ABCI_APP")
if abciApp == "" {
panic("No ABCI_APP specified")
}
fmt.Printf("Running %s test with abci=%s\n", abciApp, abciType)
appProc := startApp(abciApp)
defer appProc.StopProcess(true)
client := startClient(abciType)
defer client.Stop()
setOption(client, "serial", "on")
commit(client, nil)
deliverTx(client, []byte("abc"), types.CodeType_BadNonce, nil)
commit(client, nil)
deliverTx(client, []byte{0x00}, types.CodeType_OK, nil)
commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1})
deliverTx(client, []byte{0x00}, types.CodeType_BadNonce, nil)
deliverTx(client, []byte{0x01}, types.CodeType_OK, nil)
deliverTx(client, []byte{0x00, 0x02}, types.CodeType_OK, nil)
deliverTx(client, []byte{0x00, 0x03}, types.CodeType_OK, nil)
deliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeType_OK, nil)
deliverTx(client, []byte{0x00, 0x00, 0x06}, types.CodeType_BadNonce, nil)
commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5})
}