Skip to content

Commit 81ce655

Browse files
committed
Don't trigger deposit backup worker for non-core mints for now
1 parent fcc11ac commit 81ce655

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/code/server/account/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func (s *server) GetTokenAccountInfos(ctx context.Context, req *accountpb.GetTok
238238

239239
// Trigger a deposit sync with the blockchain for the primary account, if it exists
240240
for _, records := range filteredRecords {
241-
if records.General.AccountType == commonpb.AccountType_PRIMARY && !records.General.RequiresDepositSync {
241+
if records.General.AccountType == commonpb.AccountType_PRIMARY && !records.General.RequiresDepositSync && records.General.MintAccount == common.CoreMintAccount.PublicKey().ToBase58() {
242242
records.General.RequiresDepositSync = true
243243
err = s.data.UpdateAccountInfo(ctx, records.General)
244244
if err != nil {

pkg/code/server/account/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func TestGetTokenAccountInfos_UserAccounts_HappyPath(t *testing.T) {
249249
primaryAccountInfoRecordsByMint, err := env.data.GetLatestAccountInfoByOwnerAddressAndType(env.ctx, ownerAccount.PublicKey().ToBase58(), commonpb.AccountType_PRIMARY)
250250
require.NoError(t, err)
251251
assert.True(t, primaryAccountInfoRecordsByMint[common.CoreMintAccount.PublicKey().ToBase58()].RequiresDepositSync)
252-
assert.True(t, primaryAccountInfoRecordsByMint[jeffyVmConfig.Mint.PublicKey().ToBase58()].RequiresDepositSync)
252+
assert.False(t, primaryAccountInfoRecordsByMint[jeffyVmConfig.Mint.PublicKey().ToBase58()].RequiresDepositSync)
253253
}
254254

255255
func TestGetTokenAccountInfos_RemoteSendGiftCard_HappyPath(t *testing.T) {

0 commit comments

Comments
 (0)