@@ -39,23 +39,23 @@ func (s *StoreTestSuite) TestMessageStoreSetNextMsgSeqNumRefreshIncrNextMsgSeqNu
3939 s .Require ().Nil (s .MsgStore .Refresh ())
4040
4141 // Then the sender and target seqnums should still be
42- s .Equal (867 , s .MsgStore .NextSenderMsgSeqNum ())
43- s .Equal (5309 , s .MsgStore .NextTargetMsgSeqNum ())
42+ s .Equal (uint64 ( 867 ) , s .MsgStore .NextSenderMsgSeqNum ())
43+ s .Equal (uint64 ( 5309 ) , s .MsgStore .NextTargetMsgSeqNum ())
4444
4545 // When the sender and target seqnums are incremented
4646 s .Require ().Nil (s .MsgStore .IncrNextSenderMsgSeqNum ())
4747 s .Require ().Nil (s .MsgStore .IncrNextTargetMsgSeqNum ())
4848
4949 // Then the sender and target seqnums should be
50- s .Equal (868 , s .MsgStore .NextSenderMsgSeqNum ())
51- s .Equal (5310 , s .MsgStore .NextTargetMsgSeqNum ())
50+ s .Equal (uint64 ( 868 ) , s .MsgStore .NextSenderMsgSeqNum ())
51+ s .Equal (uint64 ( 5310 ) , s .MsgStore .NextTargetMsgSeqNum ())
5252
5353 // When the store is refreshed from its backing store
5454 s .Require ().Nil (s .MsgStore .Refresh ())
5555
5656 // Then the sender and target seqnums should still be
57- s .Equal (868 , s .MsgStore .NextSenderMsgSeqNum ())
58- s .Equal (5310 , s .MsgStore .NextTargetMsgSeqNum ())
57+ s .Equal (uint64 ( 868 ) , s .MsgStore .NextSenderMsgSeqNum ())
58+ s .Equal (uint64 ( 5310 ) , s .MsgStore .NextTargetMsgSeqNum ())
5959}
6060
6161func (s * StoreTestSuite ) TestMessageStoreReset () {
@@ -67,18 +67,18 @@ func (s *StoreTestSuite) TestMessageStoreReset() {
6767 s .Require ().Nil (s .MsgStore .Reset ())
6868
6969 // Then the sender and target seqnums should be
70- s .Equal (1 , s .MsgStore .NextSenderMsgSeqNum ())
71- s .Equal (1 , s .MsgStore .NextTargetMsgSeqNum ())
70+ s .Equal (uint64 ( 1 ) , s .MsgStore .NextSenderMsgSeqNum ())
71+ s .Equal (uint64 ( 1 ) , s .MsgStore .NextTargetMsgSeqNum ())
7272
7373 // When the store is refreshed from its backing store
7474 s .Require ().Nil (s .MsgStore .Refresh ())
7575
7676 // Then the sender and target seqnums should still be
77- s .Equal (1 , s .MsgStore .NextSenderMsgSeqNum ())
78- s .Equal (1 , s .MsgStore .NextTargetMsgSeqNum ())
77+ s .Equal (uint64 ( 1 ) , s .MsgStore .NextSenderMsgSeqNum ())
78+ s .Equal (uint64 ( 1 ) , s .MsgStore .NextTargetMsgSeqNum ())
7979}
8080
81- func (s * StoreTestSuite ) fetchMessages (beginSeqNum , endSeqNum int ) (msgs [][]byte ) {
81+ func (s * StoreTestSuite ) fetchMessages (beginSeqNum , endSeqNum uint64 ) (msgs [][]byte ) {
8282 s .T ().Helper ()
8383
8484 // Fetch messages from the new iterator
@@ -102,16 +102,16 @@ func (s *StoreTestSuite) fetchMessages(beginSeqNum, endSeqNum int) (msgs [][]byt
102102
103103func (s * StoreTestSuite ) TestMessageStoreSaveMessageGetMessage () {
104104 // Given the following saved messages
105- expectedMsgsBySeqNum := map [int ]string {
105+ expectedMsgsBySeqNum := map [uint64 ]string {
106106 1 : "In the frozen land of Nador" ,
107107 2 : "they were forced to eat Robin's minstrels" ,
108108 3 : "and there was much rejoicing" ,
109109 }
110- var seqNums []int
110+ var seqNums []uint64
111111 for seqNum := range expectedMsgsBySeqNum {
112112 seqNums = append (seqNums , seqNum )
113113 }
114- sort .Ints (seqNums )
114+ sort .Slice (seqNums , func ( i , j int ) bool { return seqNums [ i ] < seqNums [ j ] } )
115115 for _ , seqNum := range seqNums {
116116 s .Require ().Nil (s .MsgStore .SaveMessage (seqNum , []byte (expectedMsgsBySeqNum [seqNum ])))
117117 }
@@ -142,20 +142,20 @@ func (s *StoreTestSuite) TestMessageStoreSaveMessageAndIncrementGetMessage() {
142142 s .Require ().Nil (s .MsgStore .SetNextSenderMsgSeqNum (420 ))
143143
144144 // Given the following saved messages
145- expectedMsgsBySeqNum := map [int ]string {
145+ expectedMsgsBySeqNum := map [uint64 ]string {
146146 1 : "In the frozen land of Nador" ,
147147 2 : "they were forced to eat Robin's minstrels" ,
148148 3 : "and there was much rejoicing" ,
149149 }
150- var seqNums []int
150+ var seqNums []uint64
151151 for seqNum := range expectedMsgsBySeqNum {
152152 seqNums = append (seqNums , seqNum )
153153 }
154- sort .Ints (seqNums )
154+ sort .Slice (seqNums , func ( i , j int ) bool { return seqNums [ i ] < seqNums [ j ] } )
155155 for _ , seqNum := range seqNums {
156156 s .Require ().Nil (s .MsgStore .SaveMessageAndIncrNextSenderMsgSeqNum (seqNum , []byte (expectedMsgsBySeqNum [seqNum ])))
157157 }
158- s .Equal (423 , s .MsgStore .NextSenderMsgSeqNum ())
158+ s .Equal (uint64 ( 423 ) , s .MsgStore .NextSenderMsgSeqNum ())
159159
160160 // When the messages are retrieved from the MessageStore
161161 actualMsgs := s .fetchMessages (1 , 3 )
@@ -172,7 +172,7 @@ func (s *StoreTestSuite) TestMessageStoreSaveMessageAndIncrementGetMessage() {
172172 // And the messages are retrieved from the MessageStore
173173 actualMsgs = s .fetchMessages (1 , 3 )
174174
175- s .Equal (423 , s .MsgStore .NextSenderMsgSeqNum ())
175+ s .Equal (uint64 ( 423 ) , s .MsgStore .NextSenderMsgSeqNum ())
176176
177177 // Then the messages should still be
178178 s .Require ().Len (actualMsgs , 3 )
@@ -199,7 +199,7 @@ func (s *StoreTestSuite) TestMessageStoreGetMessagesVariousRanges() {
199199
200200 // When the following requests are made to the store
201201 var testCases = []struct {
202- beginSeqNo , endSeqNo int
202+ beginSeqNo , endSeqNo uint64
203203 expectedBytes [][]byte
204204 }{
205205 {beginSeqNo : 1 , endSeqNo : 1 , expectedBytes : [][]byte {[]byte ("hello" )}},
0 commit comments