|
|
@ -104,7 +104,7 @@ func (cli *grpcClient) StopForError(err error) { |
|
|
|
func (cli *grpcClient) Error() error { |
|
|
|
cli.mtx.Lock() |
|
|
|
defer cli.mtx.Unlock() |
|
|
|
return cli.err |
|
|
|
return errors.Wrap(cli.err, types.HumanCode(types.CodeType_InternalError)) |
|
|
|
} |
|
|
|
|
|
|
|
// Set listener for all responses
|
|
|
@ -270,18 +270,12 @@ func (cli *grpcClient) SetOptionSync(key string, value string) (log string, err |
|
|
|
|
|
|
|
func (cli *grpcClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) { |
|
|
|
reqres := cli.DeliverTxAsync(tx) |
|
|
|
if err := cli.Error(); err != nil { |
|
|
|
return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) |
|
|
|
} |
|
|
|
return reqres.Response.GetDeliverTx(), nil |
|
|
|
return reqres.Response.GetDeliverTx(), cli.Error() |
|
|
|
} |
|
|
|
|
|
|
|
func (cli *grpcClient) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) { |
|
|
|
reqres := cli.CheckTxAsync(tx) |
|
|
|
if err := cli.Error(); err != nil { |
|
|
|
return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) |
|
|
|
} |
|
|
|
return reqres.Response.GetCheckTx(), nil |
|
|
|
return reqres.Response.GetCheckTx(), cli.Error() |
|
|
|
} |
|
|
|
|
|
|
|
func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { |
|
|
@ -291,10 +285,7 @@ func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, |
|
|
|
|
|
|
|
func (cli *grpcClient) CommitSync() (*types.ResponseCommit, error) { |
|
|
|
reqres := cli.CommitAsync() |
|
|
|
if err := cli.Error(); err != nil { |
|
|
|
return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) |
|
|
|
} |
|
|
|
return reqres.Response.GetCommit(), nil |
|
|
|
return reqres.Response.GetCommit(), cli.Error() |
|
|
|
} |
|
|
|
|
|
|
|
func (cli *grpcClient) InitChainSync(params types.RequestInitChain) error { |
|
|
|