mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 04:41:22 +00:00
broadcast_tx via grpc
This commit is contained in:
18
rpc/grpc/api.go
Normal file
18
rpc/grpc/api.go
Normal file
@ -0,0 +1,18 @@
|
||||
package core_grpc
|
||||
|
||||
import (
|
||||
core "github.com/tendermint/tendermint/rpc/core"
|
||||
|
||||
context "golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type broadcastAPI struct {
|
||||
}
|
||||
|
||||
func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) {
|
||||
res, err := core.BroadcastTxCommit(req.Tx)
|
||||
if res == nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ResponseBroadcastTx{uint64(res.Code), res.Data, res.Log}, err
|
||||
}
|
Reference in New Issue
Block a user