Skip to content

Commit

Permalink
feat(MMI-5803): Support transactions from account snaps that should n…
Browse files Browse the repository at this point in the history
…ot be published
  • Loading branch information
shane-t committed Nov 25, 2024
1 parent 704d3ce commit 0eba828
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
8 changes: 2 additions & 6 deletions packages/transaction-controller/src/TransactionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ export class TransactionController extends BaseController<
transactionMeta: TransactionMeta,
) => boolean;

private readonly beforePublish: (transactionMeta: TransactionMeta) => boolean;
private readonly beforePublish: (transactionMeta: TransactionMeta, rawTx: string) => boolean;

Check failure on line 662 in packages/transaction-controller/src/TransactionController.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

Replace `transactionMeta:·TransactionMeta,·rawTx:·string` with `⏎····transactionMeta:·TransactionMeta,⏎····rawTx:·string,⏎··`

private readonly publish: (
transactionMeta: TransactionMeta,
Expand Down Expand Up @@ -2013,10 +2013,6 @@ export class TransactionController extends BaseController<
);
}

if (!transactionMeta.custodyId) {
throw new Error('Transaction must be a custodian transaction');
}

if (
status &&
![
Expand Down Expand Up @@ -2604,7 +2600,7 @@ export class TransactionController extends BaseController<
() => this.signTransaction(transactionMeta, transactionMeta.txParams),
);

if (!this.beforePublish(transactionMeta)) {
if (!this.beforePublish(transactionMeta, rawTx)) {
log('Skipping publishing transaction based on hook');
this.messagingSystem.publish(
`${controllerName}:transactionPublishingSkipped`,
Expand Down
10 changes: 0 additions & 10 deletions packages/transaction-controller/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ type TransactionMetaBase = {
*/
currentTokenBalance?: string;

/**
* Unique ID for custodian transaction.
*/
custodyId?: string;

/**
* Custodian transaction status.
*/
custodyStatus?: string;

/** The optional custom nonce override as a decimal string. */
customNonceValue?: string;

Expand Down

0 comments on commit 0eba828

Please sign in to comment.