Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0df4381

Browse files
committedJun 5, 2024
refactor: update sub-account-transfer-history time argument as int64 instead of time
1 parent 3d13398 commit 0df4381

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed
 

‎v2/subaccount_service.go

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package binance
33
import (
44
"context"
55
"net/http"
6-
"time"
76
)
87

98
// TransferToSubAccountService transfer to subaccount
@@ -698,15 +697,13 @@ func (s *SubAccountTransferHistoryService) TransferType(v SubAccountTransferType
698697
return s
699698
}
700699

701-
func (s *SubAccountTransferHistoryService) StartTime(t time.Time) *SubAccountTransferHistoryService {
702-
startTimestamp := t.UnixMilli()
703-
s.startTime = &startTimestamp
700+
func (s *SubAccountTransferHistoryService) StartTime(v int64) *SubAccountTransferHistoryService {
701+
s.startTime = &v
704702
return s
705703
}
706704

707-
func (s *SubAccountTransferHistoryService) EndTime(t time.Time) *SubAccountTransferHistoryService {
708-
endTimestamp := t.UnixMilli()
709-
s.endTime = &endTimestamp
705+
func (s *SubAccountTransferHistoryService) EndTime(v int64) *SubAccountTransferHistoryService {
706+
s.endTime = &v
710707
return s
711708
}
712709

‎v2/subaccount_service_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,14 @@ func (s *subAccountServiceTestSuite) TestSubAccountTransferHistoryService() {
368368
defer s.assertDo()
369369

370370
transferType := SubAccountTransferTypeTransferIn
371-
startTime := time.Date(2018, 9, 15, 0, 0, 0, 0, time.UTC)
372-
endTime := time.Date(2018, 9, 16, 0, 0, 0, 0, time.UTC)
371+
startTime := time.Date(2018, 9, 15, 0, 0, 0, 0, time.UTC).UnixMilli()
372+
endTime := time.Date(2018, 9, 16, 0, 0, 0, 0, time.UTC).UnixMilli()
373373

374374
s.assertReq(func(r *request) {
375375
e := newSignedRequest().setParams(params{
376376
"type": int(transferType),
377-
"startTime": startTime.UnixMilli(),
378-
"endTime": endTime.UnixMilli(),
377+
"startTime": startTime,
378+
"endTime": endTime,
379379
})
380380
s.assertRequestEqual(e, r)
381381
})

0 commit comments

Comments
 (0)
Please sign in to comment.