Skip to content

Commit

Permalink
Include transactions from all networks in state logs (#13599)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiranjanaBinoy authored Feb 14, 2022
1 parent 2b1256f commit b42e1f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,7 @@ export default class MetamaskController extends EventEmitter {
createTransactionEventFragment: txController.createTransactionEventFragment.bind(
txController,
),
getTransactions: txController.getTransactions.bind(txController),

// messageManager
signMessage: this.signMessage.bind(this),
Expand Down
9 changes: 6 additions & 3 deletions ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,13 @@ function maskObject(object, mask) {
}

function setupDebuggingHelpers(store) {
window.getCleanAppState = function () {
window.getCleanAppState = async function () {
const state = clone(store.getState());
state.version = global.platform.getVersion();
state.browser = window.navigator.userAgent;
state.completeTxList = await actions.getTransactions({
filterToCurrentNetwork: false,
});
return state;
};
window.getSentryState = function () {
Expand All @@ -200,8 +203,8 @@ function setupDebuggingHelpers(store) {
};
}

window.logStateString = function (cb) {
const state = window.getCleanAppState();
window.logStateString = async function (cb) {
const state = await window.getCleanAppState();
global.platform.getPlatformInfo((err, platform) => {
if (err) {
cb(err);
Expand Down
4 changes: 4 additions & 0 deletions ui/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,10 @@ export function updateAndApproveTx(txData, dontShowLoadingIndicator) {
};
}

export async function getTransactions(filters = {}) {
return await promisifiedBackground.getTransactions(filters);
}

export function completedTx(id) {
return (dispatch, getState) => {
const state = getState();
Expand Down

0 comments on commit b42e1f7

Please sign in to comment.