@@ -125,9 +125,17 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
125
125
sendingPhone .resetConfig ()
126
126
receivingPhone .resetConfig ()
127
127
128
+ // [Cash Transactions] sendingPhone WITHDREW $32.1 USD of Kin
129
+ // [Verified Merchant] receivingPhone DEPOSITED $32.1 USD of Kin
128
130
sendingPhone .publiclyWithdraw777KinToCodeUserBetweenRelationshipAccounts (t , merchantDomain , receivingPhone ).requireSuccess (t )
131
+
132
+ // [Cash Transactions] sendingPhone WITHDREW $32.1 USD of Kin
133
+ // [Verified Merchant] receivingPhone DEPOSITED $32.1 USD of Kin
129
134
sendingPhone .privatelyWithdraw321KinToCodeUserRelationshipAccount (t , receivingPhone , merchantDomain ).requireSuccess (t )
130
135
136
+ // [Verified Merchant] receivingPhone DEPOSITED 12,345 Kin
137
+ server .simulateExternalDepositHistoryItem (t , receivingPhone .parentAccount , getTimelockVault (t , receivingPhone .getAuthorityForRelationshipAccount (t , merchantDomain )), kin .ToQuarks (12_345 ))
138
+
131
139
//
132
140
// New chat assertions below
133
141
//
@@ -326,7 +334,7 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
326
334
327
335
chatMessageRecords , err = server .data .GetAllChatMessages (server .ctx , chat .GetChatId ("example.com" , receivingPhone .parentAccount .PublicKey ().ToBase58 (), true ))
328
336
require .NoError (t , err )
329
- require .Len (t , chatMessageRecords , 4 )
337
+ require .Len (t , chatMessageRecords , 5 )
330
338
331
339
protoChatMessage = getProtoChatMessage (t , chatMessageRecords [0 ])
332
340
require .Len (t , protoChatMessage .Content , 1 )
@@ -364,6 +372,15 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
364
372
assert .Equal (t , 32.1 , protoChatMessage .Content [0 ].GetExchangeData ().GetExact ().NativeAmount )
365
373
assert .Equal (t , kin .ToQuarks (321 ), protoChatMessage .Content [0 ].GetExchangeData ().GetExact ().Quarks )
366
374
375
+ protoChatMessage = getProtoChatMessage (t , chatMessageRecords [4 ])
376
+ require .Len (t , protoChatMessage .Content , 1 )
377
+ require .NotNil (t , protoChatMessage .Content [0 ].GetExchangeData ())
378
+ assert .Equal (t , chatpb .ExchangeDataContent_DEPOSITED , protoChatMessage .Content [0 ].GetExchangeData ().Verb )
379
+ assert .EqualValues (t , currency_lib .KIN , protoChatMessage .Content [0 ].GetExchangeData ().GetExact ().Currency )
380
+ assert .Equal (t , 1.0 , protoChatMessage .Content [0 ].GetExchangeData ().GetExact ().ExchangeRate )
381
+ assert .Equal (t , 12_345.0 , protoChatMessage .Content [0 ].GetExchangeData ().GetExact ().NativeAmount )
382
+ assert .Equal (t , kin .ToQuarks (12_345 ), protoChatMessage .Content [0 ].GetExchangeData ().GetExact ().Quarks )
383
+
367
384
chatMessageRecords , err = server .data .GetAllChatMessages (server .ctx , chat .GetChatId ("example.com" , receivingPhone .parentAccount .PublicKey ().ToBase58 (), false ))
368
385
require .NoError (t , err )
369
386
require .Len (t , chatMessageRecords , 1 )
@@ -567,7 +584,7 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
567
584
assert .False (t , items [13 ].IsMicroPayment )
568
585
569
586
items = receivingPhone .getPaymentHistory (t )
570
- require .Len (t , items , 13 )
587
+ require .Len (t , items , 14 )
571
588
572
589
assert .Equal (t , transactionpb .PaymentHistoryItem_RECEIVE , items [0 ].PaymentType )
573
590
assert .Equal (t , kin .ToQuarks (42 ), items [0 ].ExchangeData .Quarks )
@@ -737,6 +754,19 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
737
754
assert .False (t , items [12 ].IsAirdrop )
738
755
assert .Equal (t , transactionpb .AirdropType_UNKNOWN , items [12 ].AirdropType )
739
756
assert .False (t , items [12 ].IsMicroPayment )
757
+
758
+ assert .Equal (t , transactionpb .PaymentHistoryItem_RECEIVE , items [13 ].PaymentType )
759
+ assert .Equal (t , kin .ToQuarks (12_345 ), items [13 ].ExchangeData .Quarks )
760
+ assert .EqualValues (t , currency_lib .KIN , items [13 ].ExchangeData .Currency )
761
+ assert .EqualValues (t , 1.0 , items [13 ].ExchangeData .ExchangeRate )
762
+ assert .EqualValues (t , 12_345.0 , items [13 ].ExchangeData .NativeAmount )
763
+ assert .False (t , items [13 ].IsWithdraw )
764
+ assert .True (t , items [13 ].IsDeposit )
765
+ assert .False (t , items [13 ].IsRemoteSend )
766
+ assert .False (t , items [13 ].IsReturned )
767
+ assert .False (t , items [13 ].IsAirdrop )
768
+ assert .Equal (t , transactionpb .AirdropType_UNKNOWN , items [13 ].AirdropType )
769
+ assert .False (t , items [13 ].IsMicroPayment )
740
770
}
741
771
742
772
func TestGetPaymentHistory_NoPayments (t * testing.T ) {
0 commit comments