Skip to content

Commit 827d94f

Browse files
committed
Fix issue with fee payments not being submitted
1 parent f47333e commit 827d94f

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

pkg/code/async/sequencer/fulfillment_handler.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func (h *NoPrivacyTransferWithAuthorityFulfillmentHandler) MakeOnDemandTransacti
348348
return nil, err
349349
}
350350

351-
_, destinationeMemory, destinationIndex, err := getVirtualTimelockAccountStateInMemory(ctx, h.vmIndexerClient, common.CodeVmAccount, destinationAuthority)
351+
_, destinationMemory, destinationIndex, err := getVirtualTimelockAccountStateInMemory(ctx, h.vmIndexerClient, common.CodeVmAccount, destinationAuthority)
352352
if err != nil {
353353
return nil, err
354354
}
@@ -364,15 +364,22 @@ func (h *NoPrivacyTransferWithAuthorityFulfillmentHandler) MakeOnDemandTransacti
364364
nonceIndex,
365365
sourceMemory,
366366
sourceIndex,
367-
destinationeMemory,
367+
destinationMemory,
368368
destinationIndex,
369369

370370
*actionRecord.Quantity,
371371
)
372372
} else {
373-
isCreateOnSend, err := h.data.HasFeeAction(ctx, fulfillmentRecord.Intent, transactionpb.FeePaymentAction_CREATE_ON_SEND_WITHDRAWAL)
374-
if err != nil {
375-
return &solana.Transaction{}, err
373+
isFeePayment := actionRecord.FeeType != nil
374+
375+
var isCreateOnSend bool
376+
// The Fee payment can be an external transfer, but we know the account
377+
// already exists and doesn't need an idempotent create instruction
378+
if !isFeePayment {
379+
isCreateOnSend, err = h.data.HasFeeAction(ctx, fulfillmentRecord.Intent, transactionpb.FeePaymentAction_CREATE_ON_SEND_WITHDRAWAL)
380+
if err != nil {
381+
return &solana.Transaction{}, err
382+
}
376383
}
377384

378385
var destinationOwnerAccount *common.Account
@@ -540,7 +547,7 @@ func (h *NoPrivacyWithdrawFulfillmentHandler) MakeOnDemandTransaction(ctx contex
540547
return nil, err
541548
}
542549

543-
_, destinationeMemory, destinationIndex, err := getVirtualTimelockAccountStateInMemory(ctx, h.vmIndexerClient, common.CodeVmAccount, destinationAuthority)
550+
_, destinationMemory, destinationIndex, err := getVirtualTimelockAccountStateInMemory(ctx, h.vmIndexerClient, common.CodeVmAccount, destinationAuthority)
544551
if err != nil {
545552
return nil, err
546553
}
@@ -556,7 +563,7 @@ func (h *NoPrivacyWithdrawFulfillmentHandler) MakeOnDemandTransaction(ctx contex
556563
nonceIndex,
557564
sourceMemory,
558565
sourceIndex,
559-
destinationeMemory,
566+
destinationMemory,
560567
destinationIndex,
561568
)
562569
} else {

0 commit comments

Comments
 (0)