@@ -125,9 +125,17 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
125125 sendingPhone .resetConfig ()
126126 receivingPhone .resetConfig ()
127127
128+ // [Cash Transactions] sendingPhone WITHDREW $32.1 USD of Kin
129+ // [Verified Merchant] receivingPhone DEPOSITED $32.1 USD of Kin
128130 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
129134 sendingPhone .privatelyWithdraw321KinToCodeUserRelationshipAccount (t , receivingPhone , merchantDomain ).requireSuccess (t )
130135
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+
131139 //
132140 // New chat assertions below
133141 //
@@ -326,7 +334,7 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
326334
327335 chatMessageRecords , err = server .data .GetAllChatMessages (server .ctx , chat .GetChatId ("example.com" , receivingPhone .parentAccount .PublicKey ().ToBase58 (), true ))
328336 require .NoError (t , err )
329- require .Len (t , chatMessageRecords , 4 )
337+ require .Len (t , chatMessageRecords , 5 )
330338
331339 protoChatMessage = getProtoChatMessage (t , chatMessageRecords [0 ])
332340 require .Len (t , protoChatMessage .Content , 1 )
@@ -364,6 +372,15 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
364372 assert .Equal (t , 32.1 , protoChatMessage .Content [0 ].GetExchangeData ().GetExact ().NativeAmount )
365373 assert .Equal (t , kin .ToQuarks (321 ), protoChatMessage .Content [0 ].GetExchangeData ().GetExact ().Quarks )
366374
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+
367384 chatMessageRecords , err = server .data .GetAllChatMessages (server .ctx , chat .GetChatId ("example.com" , receivingPhone .parentAccount .PublicKey ().ToBase58 (), false ))
368385 require .NoError (t , err )
369386 require .Len (t , chatMessageRecords , 1 )
@@ -567,7 +584,7 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
567584 assert .False (t , items [13 ].IsMicroPayment )
568585
569586 items = receivingPhone .getPaymentHistory (t )
570- require .Len (t , items , 13 )
587+ require .Len (t , items , 14 )
571588
572589 assert .Equal (t , transactionpb .PaymentHistoryItem_RECEIVE , items [0 ].PaymentType )
573590 assert .Equal (t , kin .ToQuarks (42 ), items [0 ].ExchangeData .Quarks )
@@ -737,6 +754,19 @@ func TestPaymentHistory_HappyPath(t *testing.T) {
737754 assert .False (t , items [12 ].IsAirdrop )
738755 assert .Equal (t , transactionpb .AirdropType_UNKNOWN , items [12 ].AirdropType )
739756 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 )
740770}
741771
742772func TestGetPaymentHistory_NoPayments (t * testing.T ) {
0 commit comments