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.

32 lines
677 B

  1. package core_grpc
  2. import (
  3. core "github.com/tendermint/tendermint/rpc/core"
  4. abci "github.com/tendermint/abci/types"
  5. context "golang.org/x/net/context"
  6. )
  7. type broadcastAPI struct {
  8. }
  9. func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) {
  10. res, err := core.BroadcastTxCommit(req.Tx)
  11. if err != nil {
  12. return nil, err
  13. }
  14. return &ResponseBroadcastTx{
  15. CheckTx: &abci.ResponseCheckTx{
  16. Code: res.CheckTx.Code,
  17. Data: res.CheckTx.Data,
  18. Log: res.CheckTx.Log,
  19. },
  20. DeliverTx: &abci.ResponseDeliverTx{
  21. Code: res.DeliverTx.Code,
  22. Data: res.DeliverTx.Data,
  23. Log: res.DeliverTx.Log,
  24. },
  25. }, nil
  26. }