File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
pkg/code/server/grpc/transaction/v2 Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -446,8 +446,8 @@ func (s *transactionServer) validateSwap(
446
446
// Part 1: Expected instructions sanity check
447
447
//
448
448
449
- if len (ixns .ComputeBudgetInstructions ) != 0 && len ( ixns . ComputeBudgetInstructions ) != 2 {
450
- return newSwapValidationError ("expected zero or two compute budget instructions" )
449
+ if len (ixns .ComputeBudgetInstructions ) > 2 {
450
+ return newSwapValidationError ("expected at most two compute budget instructions" )
451
451
}
452
452
453
453
if ixns .TokenLedgerInstruction != nil || ixns .CleanupInstruction != nil {
@@ -458,7 +458,7 @@ func (s *transactionServer) validateSwap(
458
458
// Part 2: Compute budget instructions
459
459
//
460
460
461
- if len (ixns .ComputeBudgetInstructions ) > 0 {
461
+ if len (ixns .ComputeBudgetInstructions ) == 2 {
462
462
if ! bytes .Equal (ixns .ComputeBudgetInstructions [0 ].Program , compute_budget .ProgramKey ) || ! bytes .Equal (ixns .ComputeBudgetInstructions [1 ].Program , compute_budget .ProgramKey ) {
463
463
return newSwapValidationError ("invalid ComputeBudget program key" )
464
464
}
You can’t perform that action at this time.
0 commit comments