Skip to content

Commit

Permalink
remove unused method updateTransactionUserSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistevam committed Jul 26, 2023
1 parent 9cded12 commit ec2306a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
21 changes: 0 additions & 21 deletions app/scripts/controllers/transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,27 +557,6 @@ export default class TransactionController extends EventEmitter {
return this._getTransaction(txId);
}

/**
* updates a transaction's user settings only if the transaction state is unapproved
*
* @param {string} txId
* @param {object} userSettings - holds the metadata
* @param {string} userSettings.userEditedGasLimit
* @param {string} userSettings.userFeeLevel
* @returns {TransactionMeta} the txMeta of the updated transaction
*/
updateTransactionUserSettings(txId, { userEditedGasLimit, userFeeLevel }) {
this._throwErrorIfNotUnapprovedTx(txId, 'updateTransactionUserSettings');

let userSettings = { userEditedGasLimit, userFeeLevel };
// only update what is defined
userSettings = pickBy(userSettings);

const note = `Update User Settings for ${txId}`;
this._updateTransaction(txId, userSettings, note);
return this._getTransaction(txId);
}

/**
* append new sendFlowHistory to the transaction with id if the transaction
* state is unapproved. Returns the updated transaction.
Expand Down
11 changes: 0 additions & 11 deletions app/scripts/controllers/transactions/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3021,17 +3021,6 @@ describe('Transaction Controller', function () {
assert.equal(result.estimateUsed, '0x0055');
});

it('updates transaction user settings', function () {
txController.updateTransactionUserSettings('1', {
userEditedGasLimit: '0x0088',
userFeeLevel: 'high',
});

const result = txStateManager.getTransaction('1');
assert.equal(result.userEditedGasLimit, '0x0088');
assert.equal(result.userFeeLevel, 'high');
});

it('should not update and should throw error if status is not type "unapproved"', function () {
txStateManager.addTransaction({
id: '4',
Expand Down

0 comments on commit ec2306a

Please sign in to comment.