Skip to content

Commit

Permalink
Ditch TxV1 (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleyvega committed Jul 19, 2021
1 parent 01dad6d commit e3efa43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 31 deletions.
14 changes: 7 additions & 7 deletions bot/normal/mocks/node_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions node/grpcnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,6 @@ func (n *GRPCNode) GetAddress() (url.URL, error) {

// === Trading ===

// SubmitTransaction submits a signed transaction
func (n *GRPCNode) SubmitTransaction(req *api.SubmitTransactionRequest) (response *api.SubmitTransactionResponse, err error) {
msg := "gRPC call failed: SubmitTransaction: %w"
if n == nil {
err = fmt.Errorf(msg, e.ErrNil)
return
}

if n.conn.GetState() != connectivity.Ready {
err = fmt.Errorf(msg, e.ErrConnectionNotReady)
return
}

c := api.NewTradingServiceClient(n.conn)
ctx, cancel := context.WithTimeout(context.Background(), n.callTimeout)
defer cancel()

response, err = c.SubmitTransaction(ctx, req)
if err != nil {
err = fmt.Errorf(msg, apigrpc.ErrorDetail(err))
}
return
}

// SubmitTransactionV2 submits a signed v2 transaction
func (n *GRPCNode) SubmitTransactionV2(req *api.SubmitTransactionV2Request) (response *api.SubmitTransactionV2Response, err error) {
msg := "gRPC call failed: SubmitTransactionV2: %w"
Expand Down

0 comments on commit e3efa43

Please sign in to comment.