Skip to content

Commit a193dc1

Browse files
committed
Improve relationship account tests for GetTokenAccountInfos
1 parent 4df5073 commit a193dc1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/code/server/grpc/account/server_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,19 @@ func TestGetTokenAccountInfos_UserAccounts_HappyPath(t *testing.T) {
260260
assert.Equal(t, commonpb.AccountType_RELATIONSHIP, accountInfo.AccountType)
261261
assert.EqualValues(t, 0, accountInfo.Index)
262262
assert.EqualValues(t, kin.ToQuarks(999), accountInfo.Balance)
263+
require.NotNil(t, accountInfo.Relationship)
264+
assert.Equal(t, *relationship1AccountRecords.General.RelationshipTo, accountInfo.Relationship.GetDomain().Value)
263265
case relationship2DerivedOwner.PublicKey().ToBase58():
264266
assert.Equal(t, commonpb.AccountType_RELATIONSHIP, accountInfo.AccountType)
265267
assert.EqualValues(t, 0, accountInfo.Index)
266268
assert.EqualValues(t, kin.ToQuarks(5), accountInfo.Balance)
269+
require.NotNil(t, accountInfo.Relationship)
270+
assert.Equal(t, *relationship2AccountRecords.General.RelationshipTo, accountInfo.Relationship.GetDomain().Value)
267271
default:
268272
require.Fail(t, "unexpected authority")
269273
}
270274

271-
if accountInfo.AccountType == commonpb.AccountType_RELATIONSHIP {
272-
require.NotNil(t, accountInfo.Relationship)
273-
} else {
275+
if accountInfo.AccountType != commonpb.AccountType_RELATIONSHIP {
274276
assert.Nil(t, accountInfo.Relationship)
275277
}
276278

0 commit comments

Comments
 (0)