Skip to content

Commit 773fc89

Browse files
committed
fix(transaction-pay-controller): remove id/signatureKind from ServerSignatureStep, fix balance check and batch gas alignment
1 parent 828ebb2 commit 773fc89

3 files changed

Lines changed: 11 additions & 13 deletions

File tree

packages/transaction-pay-controller/src/strategy/server/server-submit.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ describe('submitServerQuotes', () => {
676676
const SIGNATURE_MOCK = `0x${'a'.repeat(64)}${'b'.repeat(64)}1c`;
677677
const SIGNATURE_STEP_MOCK: ServerSignatureStep = {
678678
type: 'signature' as const,
679-
id: 'sig-step-1',
680679
sign: {
681680
domain: { name: 'Test', chainId: 137 },
682681
types: { Order: [{ name: 'amount', type: 'uint256' }] },

packages/transaction-pay-controller/src/strategy/server/server-submit.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,12 @@ async function submitTransactionSteps(
173173
return;
174174
}
175175

176-
const { isHyperliquidSource, isPostQuote } = quote.request;
176+
const { isHyperliquidSource, isPostQuote, paymentOverride } = quote.request;
177177

178-
// Skip balance check for HyperLiquid source flows (no on-chain debit) and
179-
// post-quote flows (funds come from the Safe after the original tx executes).
180-
if (!isHyperliquidSource && !isPostQuote) {
178+
// Skip balance check for HyperLiquid source flows (no on-chain debit),
179+
// post-quote flows (funds come from the Safe after the original tx executes),
180+
// and payment-override flows (funds are supplied by the override account).
181+
if (!isHyperliquidSource && !isPostQuote && !paymentOverride) {
181182
await validateSourceBalance(quote, messenger);
182183
}
183184

@@ -690,11 +691,12 @@ async function submitViaTransactionController(
690691
} else {
691692
const gasLimit7702 = is7702 ? toHex(gasLimits[0]) : undefined;
692693

693-
const batchTransactions = allParams.map((params, i) => {
694-
const gas = (gasLimit7702 ??
695-
(gasLimits[i] === undefined ? undefined : params.gas)) as
696-
| Hex
697-
| undefined;
694+
const batchTransactions = allParams.map((params) => {
695+
// params.gas was already resolved correctly by transactionStepToParams
696+
// (indexed by relay-step position), so use it directly. Indexing
697+
// allParams position into gasLimits would be wrong when payment-
698+
// override or post-quote params are prepended.
699+
const gas = (gasLimit7702 ?? params.gas) as Hex | undefined;
698700

699701
return {
700702
params: {
@@ -785,7 +787,6 @@ async function submitSignatureStep(
785787
};
786788

787789
log('Signing typed data for signature step', {
788-
stepId: step.id,
789790
primaryType: sign.primaryType,
790791
});
791792

packages/transaction-pay-controller/src/strategy/server/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ export type ServerTransactionStep = {
3434

3535
export type ServerSignatureStep = {
3636
type: 'signature';
37-
id: string;
3837
sign: {
39-
signatureKind: string;
4038
domain: Record<string, unknown>;
4139
types: Record<string, unknown>;
4240
primaryType: string;

0 commit comments

Comments
 (0)