1
0
mirror of https://github.com/fluencelabs/tendermint synced 2025-06-26 03:01:42 +00:00
Files
.github
DOCKER
benchmarks
blockchain
cmd
config
consensus
docs
evidence
lite
mempool
node
p2p
proxy
rpc
client
core
grpc
api.go
client_server.go
compile.sh
grpc_test.go
types.pb.go
types.proto
lib
test
scripts
state
test
types
version
.codecov.yml
.editorconfig
.gitignore
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
Makefile
README.md
Vagrantfile
appveyor.yml
circle.yml
glide.lock
glide.yaml
tendermint/rpc/grpc/api.go

37 lines
824 B
Go
Raw Normal View History

2016-06-21 13:19:49 -04:00
package core_grpc
import (
2017-11-14 22:30:00 +00:00
"context"
2016-06-21 13:19:49 -04:00
abci "github.com/tendermint/abci/types"
2017-10-04 16:40:45 -04:00
core "github.com/tendermint/tendermint/rpc/core"
2016-06-21 13:19:49 -04:00
)
type broadcastAPI struct {
}
func (bapi *broadcastAPI) Ping(ctx context.Context, req *RequestPing) (*ResponsePing, error) {
// dummy so we can check if the server is up
return &ResponsePing{}, nil
}
2016-06-21 13:19:49 -04:00
func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) {
res, err := core.BroadcastTxCommit(req.Tx)
if err != nil {
2016-06-21 13:19:49 -04:00
return nil, err
}
return &ResponseBroadcastTx{
CheckTx: &abci.ResponseCheckTx{
Code: res.CheckTx.Code,
Data: res.CheckTx.Data,
Log: res.CheckTx.Log,
},
DeliverTx: &abci.ResponseDeliverTx{
Code: res.DeliverTx.Code,
Data: res.DeliverTx.Data,
Log: res.DeliverTx.Log,
},
}, nil
2016-06-21 13:19:49 -04:00
}