Skip to content

Commit

Permalink
Changed orderID to uint64
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjjpppp committed Jul 17, 2020
1 parent 4121f89 commit 4843d2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 6 additions & 5 deletions v2/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package quoinex
import (
"context"
"fmt"
"github.com/jjjjpppp/quoinex-go-client/v2/models"
"strconv"
"strings"

"github.com/jjjjpppp/quoinex-go-client/v2/models"
)

func (c *Client) GetAnOrder(ctx context.Context, orderID int) (*models.Order, error) {
func (c *Client) GetAnOrder(ctx context.Context, orderID uint64) (*models.Order, error) {
spath := fmt.Sprintf("/orders/%d", orderID)
res, err := c.sendRequest(ctx, "GET", spath, nil, nil)
if err != nil {
Expand Down Expand Up @@ -70,7 +71,7 @@ func (c *Client) CreateAnOrder(ctx context.Context, orderType, side, quantity, p
return &order, nil
}

func (c *Client) CancelAnOrder(ctx context.Context, orderID int) (*models.Order, error) {
func (c *Client) CancelAnOrder(ctx context.Context, orderID uint64) (*models.Order, error) {
spath := fmt.Sprintf("/orders/%d/cancel", orderID)
res, err := c.sendRequest(ctx, "PUT", spath, nil, nil)
if err != nil {
Expand All @@ -85,7 +86,7 @@ func (c *Client) CancelAnOrder(ctx context.Context, orderID int) (*models.Order,
return &order, nil
}

func (c *Client) EditALiveOrder(ctx context.Context, orderID int, quantity, price string) (*models.Order, error) {
func (c *Client) EditALiveOrder(ctx context.Context, orderID uint64, quantity, price string) (*models.Order, error) {
spath := fmt.Sprintf("/orders/%d", orderID)
bodyTemplate :=
`{
Expand All @@ -108,7 +109,7 @@ func (c *Client) EditALiveOrder(ctx context.Context, orderID int, quantity, pric
return &order, nil
}

func (c *Client) GetAnOrderTrades(ctx context.Context, orderID int) ([]*models.Trade, error) {
func (c *Client) GetAnOrderTrades(ctx context.Context, orderID uint64) ([]*models.Trade, error) {
spath := fmt.Sprintf("/orders/%d/trades", orderID)
res, err := c.sendRequest(ctx, "GET", spath, nil, nil)
if err != nil {
Expand Down
9 changes: 5 additions & 4 deletions v2/order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package quoinex

import (
"context"
"testing"
"time"

"github.com/google/go-cmp/cmp"
"github.com/jjjjpppp/quoinex-go-client/v2/models"
"github.com/jjjjpppp/quoinex-go-client/v2/testutil"
"testing"
"time"
)

func TestGetAnOrder(t *testing.T) {
Expand Down Expand Up @@ -136,7 +137,7 @@ func TestCreateAnOrder(t *testing.T) {

func TestCancelAnOrder(t *testing.T) {
type Param struct {
orderID int
orderID uint64
jsonResponse string
}
type Expect struct {
Expand Down Expand Up @@ -174,7 +175,7 @@ func TestCancelAnOrder(t *testing.T) {

func TestEditALiveOrder(t *testing.T) {
type Param struct {
orderID int
orderID uint64
quantity string
price string
jsonResponse string
Expand Down

0 comments on commit 4843d2b

Please sign in to comment.