mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-15 22:31:21 +00:00
lint: s/common.Fmt/fmt.Sprintf
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
package abcicli
|
package abcicli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -50,7 +51,7 @@ RETRY_LOOP:
|
|||||||
if cli.mustConnect {
|
if cli.mustConnect {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
log.Warn(common.Fmt("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr))
|
log.Warn(fmt.Sprintf("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr))
|
||||||
time.Sleep(time.Second * 3)
|
time.Sleep(time.Second * 3)
|
||||||
continue RETRY_LOOP
|
continue RETRY_LOOP
|
||||||
}
|
}
|
||||||
@ -93,7 +94,7 @@ func (cli *grpcClient) StopForError(err error) {
|
|||||||
}
|
}
|
||||||
cli.mtx.Unlock()
|
cli.mtx.Unlock()
|
||||||
|
|
||||||
log.Warn(common.Fmt("Stopping abci.grpcClient for error: %v", err.Error()))
|
log.Warn(fmt.Sprintf("Stopping abci.grpcClient for error: %v", err.Error()))
|
||||||
cli.Stop()
|
cli.Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ RETRY_LOOP:
|
|||||||
if cli.mustConnect {
|
if cli.mustConnect {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
log.Warn(common.Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr))
|
log.Warn(fmt.Sprintf("abci.socketClient failed to connect to %v. Retrying...", cli.addr))
|
||||||
time.Sleep(time.Second * 3)
|
time.Sleep(time.Second * 3)
|
||||||
continue RETRY_LOOP
|
continue RETRY_LOOP
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ func (cli *socketClient) StopForError(err error) {
|
|||||||
}
|
}
|
||||||
cli.mtx.Unlock()
|
cli.mtx.Unlock()
|
||||||
|
|
||||||
log.Warn(common.Fmt("Stopping abci.socketClient for error: %v", err.Error()))
|
log.Warn(fmt.Sprintf("Stopping abci.socketClient for error: %v", err.Error()))
|
||||||
cli.Stop()
|
cli.Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ func cmdSetOption(c *cli.Context) error {
|
|||||||
return errors.New("Command set_option takes 2 arguments (key, value)")
|
return errors.New("Command set_option takes 2 arguments (key, value)")
|
||||||
}
|
}
|
||||||
res := client.SetOptionSync(args[0], args[1])
|
res := client.SetOptionSync(args[0], args[1])
|
||||||
rsp := newResponse(res, common.Fmt("%s=%s", args[0], args[1]), false)
|
rsp := newResponse(res, fmt.Sprintf("%s=%s", args[0], args[1]), false)
|
||||||
printResponse(c, rsp)
|
printResponse(c, rsp)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -284,7 +284,7 @@ func cmdCheckTx(c *cli.Context) error {
|
|||||||
// Get application Merkle root hash
|
// Get application Merkle root hash
|
||||||
func cmdCommit(c *cli.Context) error {
|
func cmdCommit(c *cli.Context) error {
|
||||||
res := client.CommitSync()
|
res := client.CommitSync()
|
||||||
rsp := newResponse(res, common.Fmt("0x%X", res.Data), false)
|
rsp := newResponse(res, fmt.Sprintf("0x%X", res.Data), false)
|
||||||
printResponse(c, rsp)
|
printResponse(c, rsp)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/tendermint/abci/server"
|
"github.com/tendermint/abci/server"
|
||||||
"github.com/tendermint/abci/types"
|
"github.com/tendermint/abci/types"
|
||||||
@ -58,7 +59,7 @@ func (app *ChainAwareApplication) Commit() types.Result {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (app *ChainAwareApplication) Query(query []byte) types.Result {
|
func (app *ChainAwareApplication) Query(query []byte) types.Result {
|
||||||
return types.NewResultOK([]byte(common.Fmt("%d,%d", app.beginCount, app.endCount)), "")
|
return types.NewResultOK([]byte(fmt.Sprintf("%d,%d", app.beginCount, app.endCount)), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) {
|
func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) {
|
||||||
|
@ -2,9 +2,9 @@ package counter
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/tendermint/abci/types"
|
"github.com/tendermint/abci/types"
|
||||||
common "github.com/tendermint/go-common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type CounterApplication struct {
|
type CounterApplication struct {
|
||||||
@ -18,7 +18,7 @@ func NewCounterApplication(serial bool) *CounterApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (app *CounterApplication) Info() types.ResponseInfo {
|
func (app *CounterApplication) Info() types.ResponseInfo {
|
||||||
return types.ResponseInfo{Data: common.Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)}
|
return types.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (app *CounterApplication) SetOption(key string, value string) (log string) {
|
func (app *CounterApplication) SetOption(key string, value string) (log string) {
|
||||||
@ -31,13 +31,13 @@ func (app *CounterApplication) SetOption(key string, value string) (log string)
|
|||||||
func (app *CounterApplication) DeliverTx(tx []byte) types.Result {
|
func (app *CounterApplication) DeliverTx(tx []byte) types.Result {
|
||||||
if app.serial {
|
if app.serial {
|
||||||
if len(tx) > 8 {
|
if len(tx) > 8 {
|
||||||
return types.ErrEncodingError.SetLog(common.Fmt("Max tx size is 8 bytes, got %d", len(tx)))
|
return types.ErrEncodingError.SetLog(fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx)))
|
||||||
}
|
}
|
||||||
tx8 := make([]byte, 8)
|
tx8 := make([]byte, 8)
|
||||||
copy(tx8[len(tx8)-len(tx):], tx)
|
copy(tx8[len(tx8)-len(tx):], tx)
|
||||||
txValue := binary.BigEndian.Uint64(tx8)
|
txValue := binary.BigEndian.Uint64(tx8)
|
||||||
if txValue != uint64(app.txCount) {
|
if txValue != uint64(app.txCount) {
|
||||||
return types.ErrBadNonce.SetLog(common.Fmt("Invalid nonce. Expected %v, got %v", app.txCount, txValue))
|
return types.ErrBadNonce.SetLog(fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
app.txCount += 1
|
app.txCount += 1
|
||||||
@ -47,13 +47,13 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.Result {
|
|||||||
func (app *CounterApplication) CheckTx(tx []byte) types.Result {
|
func (app *CounterApplication) CheckTx(tx []byte) types.Result {
|
||||||
if app.serial {
|
if app.serial {
|
||||||
if len(tx) > 8 {
|
if len(tx) > 8 {
|
||||||
return types.ErrEncodingError.SetLog(common.Fmt("Max tx size is 8 bytes, got %d", len(tx)))
|
return types.ErrEncodingError.SetLog(fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx)))
|
||||||
}
|
}
|
||||||
tx8 := make([]byte, 8)
|
tx8 := make([]byte, 8)
|
||||||
copy(tx8[len(tx8)-len(tx):], tx)
|
copy(tx8[len(tx8)-len(tx):], tx)
|
||||||
txValue := binary.BigEndian.Uint64(tx8)
|
txValue := binary.BigEndian.Uint64(tx8)
|
||||||
if txValue < uint64(app.txCount) {
|
if txValue < uint64(app.txCount) {
|
||||||
return types.ErrBadNonce.SetLog(common.Fmt("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue))
|
return types.ErrBadNonce.SetLog(fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return types.OK
|
return types.OK
|
||||||
@ -76,10 +76,10 @@ func (app *CounterApplication) Query(query []byte) types.Result {
|
|||||||
|
|
||||||
switch queryStr {
|
switch queryStr {
|
||||||
case "hash":
|
case "hash":
|
||||||
return types.NewResultOK(nil, common.Fmt("%v", app.hashCount))
|
return types.NewResultOK(nil, fmt.Sprintf("%v", app.hashCount))
|
||||||
case "tx":
|
case "tx":
|
||||||
return types.NewResultOK(nil, common.Fmt("%v", app.txCount))
|
return types.NewResultOK(nil, fmt.Sprintf("%v", app.txCount))
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.ErrUnknownRequest.SetLog(common.Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr))
|
return types.ErrUnknownRequest.SetLog(fmt.Sprintf("Invalid nonce. Expected hash or tx, got %v", queryStr))
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,10 @@ package dummy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/tendermint/abci/types"
|
"github.com/tendermint/abci/types"
|
||||||
common "github.com/tendermint/go-common"
|
|
||||||
"github.com/tendermint/go-merkle"
|
"github.com/tendermint/go-merkle"
|
||||||
"github.com/tendermint/go-wire"
|
"github.com/tendermint/go-wire"
|
||||||
)
|
)
|
||||||
@ -20,7 +20,7 @@ func NewDummyApplication() *DummyApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (app *DummyApplication) Info() (resInfo types.ResponseInfo) {
|
func (app *DummyApplication) Info() (resInfo types.ResponseInfo) {
|
||||||
return types.ResponseInfo{Data: common.Fmt("{\"size\":%v}", app.state.Size())}
|
return types.ResponseInfo{Data: fmt.Sprintf("{\"size\":%v}", app.state.Size())}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (app *DummyApplication) SetOption(key string, value string) (log string) {
|
func (app *DummyApplication) SetOption(key string, value string) (log string) {
|
||||||
|
@ -2,6 +2,7 @@ package dummy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
@ -107,7 +108,7 @@ func TestValSetChanges(t *testing.T) {
|
|||||||
nInit := 5
|
nInit := 5
|
||||||
vals := make([]*types.Validator, total)
|
vals := make([]*types.Validator, total)
|
||||||
for i := 0; i < total; i++ {
|
for i := 0; i < total; i++ {
|
||||||
pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(common.Fmt("test%d", i))).PubKey().Bytes()
|
pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(fmt.Sprintf("test%d", i))).PubKey().Bytes()
|
||||||
power := common.RandInt()
|
power := common.RandInt()
|
||||||
vals[i] = &types.Validator{pubkey, uint64(power)}
|
vals[i] = &types.Validator{pubkey, uint64(power)}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package dummy
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ func LoadLastBlock(db dbm.DB) (lastBlock LastBlockInfo) {
|
|||||||
wire.ReadBinaryPtr(&lastBlock, r, 0, n, err)
|
wire.ReadBinaryPtr(&lastBlock, r, 0, n, err)
|
||||||
if *err != nil {
|
if *err != nil {
|
||||||
// DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED
|
// DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED
|
||||||
common.Exit(common.Fmt("Data has been corrupted or its spec has changed: %v\n", *err))
|
common.Exit(fmt.Sprintf("Data has been corrupted or its spec has changed: %v\n", *err))
|
||||||
}
|
}
|
||||||
// TODO: ensure that buf is completely read.
|
// TODO: ensure that buf is completely read.
|
||||||
}
|
}
|
||||||
@ -173,7 +174,7 @@ func (app *PersistentDummyApplication) Validators() (validators []*types.Validat
|
|||||||
}
|
}
|
||||||
|
|
||||||
func MakeValSetChangeTx(pubkey []byte, power uint64) []byte {
|
func MakeValSetChangeTx(pubkey []byte, power uint64) []byte {
|
||||||
return []byte(common.Fmt("val:%X/%d", pubkey, power))
|
return []byte(fmt.Sprintf("val:%X/%d", pubkey, power))
|
||||||
}
|
}
|
||||||
|
|
||||||
func isValidatorTx(tx []byte) bool {
|
func isValidatorTx(tx []byte) bool {
|
||||||
@ -188,16 +189,16 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Result {
|
|||||||
tx = tx[len(ValidatorSetChangePrefix):]
|
tx = tx[len(ValidatorSetChangePrefix):]
|
||||||
pubKeyAndPower := strings.Split(string(tx), "/")
|
pubKeyAndPower := strings.Split(string(tx), "/")
|
||||||
if len(pubKeyAndPower) != 2 {
|
if len(pubKeyAndPower) != 2 {
|
||||||
return types.ErrEncodingError.SetLog(common.Fmt("Expected 'pubkey/power'. Got %v", pubKeyAndPower))
|
return types.ErrEncodingError.SetLog(fmt.Sprintf("Expected 'pubkey/power'. Got %v", pubKeyAndPower))
|
||||||
}
|
}
|
||||||
pubkeyS, powerS := pubKeyAndPower[0], pubKeyAndPower[1]
|
pubkeyS, powerS := pubKeyAndPower[0], pubKeyAndPower[1]
|
||||||
pubkey, err := hex.DecodeString(pubkeyS)
|
pubkey, err := hex.DecodeString(pubkeyS)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return types.ErrEncodingError.SetLog(common.Fmt("Pubkey (%s) is invalid hex", pubkeyS))
|
return types.ErrEncodingError.SetLog(fmt.Sprintf("Pubkey (%s) is invalid hex", pubkeyS))
|
||||||
}
|
}
|
||||||
power, err := strconv.Atoi(powerS)
|
power, err := strconv.Atoi(powerS)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return types.ErrEncodingError.SetLog(common.Fmt("Power (%s) is not an int", powerS))
|
return types.ErrEncodingError.SetLog(fmt.Sprintf("Power (%s) is not an int", powerS))
|
||||||
}
|
}
|
||||||
|
|
||||||
// update
|
// update
|
||||||
@ -210,14 +211,14 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types
|
|||||||
if v.Power == 0 {
|
if v.Power == 0 {
|
||||||
// remove validator
|
// remove validator
|
||||||
if !app.app.state.Has(key) {
|
if !app.app.state.Has(key) {
|
||||||
return types.ErrUnauthorized.SetLog(common.Fmt("Cannot remove non-existent validator %X", key))
|
return types.ErrUnauthorized.SetLog(fmt.Sprintf("Cannot remove non-existent validator %X", key))
|
||||||
}
|
}
|
||||||
app.app.state.Remove(key)
|
app.app.state.Remove(key)
|
||||||
} else {
|
} else {
|
||||||
// add or update validator
|
// add or update validator
|
||||||
value := bytes.NewBuffer(make([]byte, 0))
|
value := bytes.NewBuffer(make([]byte, 0))
|
||||||
if err := types.WriteMessage(v, value); err != nil {
|
if err := types.WriteMessage(v, value); err != nil {
|
||||||
return types.ErrInternalError.SetLog(common.Fmt("Error encoding validator: %v", err))
|
return types.ErrInternalError.SetLog(fmt.Sprintf("Error encoding validator: %v", err))
|
||||||
}
|
}
|
||||||
app.app.state.Set(key, value.Bytes())
|
app.app.state.Set(key, value.Bytes())
|
||||||
}
|
}
|
||||||
|
@ -41,14 +41,14 @@ func testStream(t *testing.T, app types.Application) {
|
|||||||
// Start the listener
|
// Start the listener
|
||||||
server, err := server.NewSocketServer("unix://test.sock", app)
|
server, err := server.NewSocketServer("unix://test.sock", app)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.Exit(common.Fmt("Error starting socket server: %v", err.Error()))
|
common.Exit(fmt.Sprintf("Error starting socket server: %v", err.Error()))
|
||||||
}
|
}
|
||||||
defer server.Stop()
|
defer server.Stop()
|
||||||
|
|
||||||
// Connect to the socket
|
// Connect to the socket
|
||||||
client, err := abcicli.NewSocketClient("unix://test.sock", false)
|
client, err := abcicli.NewSocketClient("unix://test.sock", false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.Exit(common.Fmt("Error starting socket client: %v", err.Error()))
|
common.Exit(fmt.Sprintf("Error starting socket client: %v", err.Error()))
|
||||||
}
|
}
|
||||||
client.Start()
|
client.Start()
|
||||||
defer client.Stop()
|
defer client.Stop()
|
||||||
@ -114,14 +114,14 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) {
|
|||||||
// Start the listener
|
// Start the listener
|
||||||
server, err := server.NewGRPCServer("unix://test.sock", app)
|
server, err := server.NewGRPCServer("unix://test.sock", app)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.Exit(common.Fmt("Error starting GRPC server: %v", err.Error()))
|
common.Exit(fmt.Sprintf("Error starting GRPC server: %v", err.Error()))
|
||||||
}
|
}
|
||||||
defer server.Stop()
|
defer server.Stop()
|
||||||
|
|
||||||
// Connect to the socket
|
// Connect to the socket
|
||||||
conn, err := grpc.Dial("unix://test.sock", grpc.WithInsecure(), grpc.WithDialer(dialerFunc))
|
conn, err := grpc.Dial("unix://test.sock", grpc.WithInsecure(), grpc.WithDialer(dialerFunc))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.Exit(common.Fmt("Error dialing GRPC server: %v", err.Error()))
|
common.Exit(fmt.Sprintf("Error dialing GRPC server: %v", err.Error()))
|
||||||
}
|
}
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ func makeRequest(conn net.Conn, req *types.Request) (*types.Response, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if _, ok := resFlush.Value.(*types.Response_Flush); !ok {
|
if _, ok := resFlush.Value.(*types.Response_Flush); !ok {
|
||||||
return nil, errors.New(common.Fmt("Expected flush response but got something else: %v", reflect.TypeOf(resFlush)))
|
return nil, errors.New(fmt.Sprintf("Expected flush response but got something else: %v", reflect.TypeOf(resFlush)))
|
||||||
}
|
}
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
|
@ -46,7 +46,7 @@ func SetOption(client abcicli.Client, key, value string) {
|
|||||||
res := client.SetOptionSync(key, value)
|
res := client.SetOptionSync(key, value)
|
||||||
_, _, log := res.Code, res.Data, res.Log
|
_, _, log := res.Code, res.Data, res.Log
|
||||||
if res.IsErr() {
|
if res.IsErr() {
|
||||||
panic(common.Fmt("setting %v=%v: \nlog: %v", key, value, log))
|
panic(fmt.Sprintf("setting %v=%v: \nlog: %v", key, value, log))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,10 +54,10 @@ func Commit(client abcicli.Client, hashExp []byte) {
|
|||||||
res := client.CommitSync()
|
res := client.CommitSync()
|
||||||
_, data, log := res.Code, res.Data, res.Log
|
_, data, log := res.Code, res.Data, res.Log
|
||||||
if res.IsErr() {
|
if res.IsErr() {
|
||||||
panic(common.Fmt("committing %v\nlog: %v", log))
|
panic(fmt.Sprintf("committing %v\nlog: %v", log))
|
||||||
}
|
}
|
||||||
if !bytes.Equal(res.Data, hashExp) {
|
if !bytes.Equal(res.Data, hashExp) {
|
||||||
panic(common.Fmt("Commit hash was unexpected. Got %X expected %X",
|
panic(fmt.Sprintf("Commit hash was unexpected. Got %X expected %X",
|
||||||
data, hashExp))
|
data, hashExp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,11 +66,11 @@ func DeliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, da
|
|||||||
res := client.DeliverTxSync(txBytes)
|
res := client.DeliverTxSync(txBytes)
|
||||||
code, data, log := res.Code, res.Data, res.Log
|
code, data, log := res.Code, res.Data, res.Log
|
||||||
if code != codeExp {
|
if code != codeExp {
|
||||||
panic(common.Fmt("DeliverTx response code was unexpected. Got %v expected %v. Log: %v",
|
panic(fmt.Sprintf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v",
|
||||||
code, codeExp, log))
|
code, codeExp, log))
|
||||||
}
|
}
|
||||||
if !bytes.Equal(data, dataExp) {
|
if !bytes.Equal(data, dataExp) {
|
||||||
panic(common.Fmt("DeliverTx response data was unexpected. Got %X expected %X",
|
panic(fmt.Sprintf("DeliverTx response data was unexpected. Got %X expected %X",
|
||||||
data, dataExp))
|
data, dataExp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,14 +79,14 @@ func CheckTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, data
|
|||||||
res := client.CheckTxSync(txBytes)
|
res := client.CheckTxSync(txBytes)
|
||||||
code, data, log := res.Code, res.Data, res.Log
|
code, data, log := res.Code, res.Data, res.Log
|
||||||
if res.IsErr() {
|
if res.IsErr() {
|
||||||
panic(common.Fmt("checking tx %X: %v\nlog: %v", txBytes, log))
|
panic(fmt.Sprintf("checking tx %X: %v\nlog: %v", txBytes, log))
|
||||||
}
|
}
|
||||||
if code != codeExp {
|
if code != codeExp {
|
||||||
panic(common.Fmt("CheckTx response code was unexpected. Got %v expected %v. Log: %v",
|
panic(fmt.Sprintf("CheckTx response code was unexpected. Got %v expected %v. Log: %v",
|
||||||
code, codeExp, log))
|
code, codeExp, log))
|
||||||
}
|
}
|
||||||
if !bytes.Equal(data, dataExp) {
|
if !bytes.Equal(data, dataExp) {
|
||||||
panic(common.Fmt("CheckTx response data was unexpected. Got %X expected %X",
|
panic(fmt.Sprintf("CheckTx response data was unexpected. Got %X expected %X",
|
||||||
data, dataExp))
|
data, dataExp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user