Skip to content

Commit

Permalink
Merge branch 'main' into fix-flaky-erc20
Browse files Browse the repository at this point in the history
  • Loading branch information
pnarayanaswamy authored Jan 14, 2025
2 parents 0521cdc + 08fb039 commit b036d93
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 58 deletions.
35 changes: 34 additions & 1 deletion lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,12 @@
"@metamask/eth-json-rpc-middleware>@metamask/utils": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": {
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": {
"packages": {
"@metamask/utils>@metamask/superstruct": true,
Expand Down Expand Up @@ -1082,7 +1088,8 @@
"@ethereumjs/tx": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": true,
"@metamask/eth-sig-util": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/types-live": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": true,
"browserify>buffer": true,
"webpack>events": true,
"@metamask/eth-trezor-keyring>hdkey": true
Expand Down Expand Up @@ -1116,6 +1123,17 @@
"@metamask/eth-sig-util>tweetnacl": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"@ethereumjs/tx>ethereum-cryptography": true,
"@metamask/eth-sig-util>tweetnacl": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
Expand Down Expand Up @@ -2064,6 +2082,21 @@
"semver": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"nock>debug": true,
"@metamask/utils>pony-cause": true,
"semver": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand Down
35 changes: 34 additions & 1 deletion lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,12 @@
"@metamask/eth-json-rpc-middleware>@metamask/utils": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": {
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": {
"packages": {
"@metamask/utils>@metamask/superstruct": true,
Expand Down Expand Up @@ -1082,7 +1088,8 @@
"@ethereumjs/tx": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": true,
"@metamask/eth-sig-util": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/types-live": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": true,
"browserify>buffer": true,
"webpack>events": true,
"@metamask/eth-trezor-keyring>hdkey": true
Expand Down Expand Up @@ -1116,6 +1123,17 @@
"@metamask/eth-sig-util>tweetnacl": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"@ethereumjs/tx>ethereum-cryptography": true,
"@metamask/eth-sig-util>tweetnacl": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
Expand Down Expand Up @@ -2064,6 +2082,21 @@
"semver": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"nock>debug": true,
"@metamask/utils>pony-cause": true,
"semver": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand Down
35 changes: 34 additions & 1 deletion lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,12 @@
"@metamask/eth-json-rpc-middleware>@metamask/utils": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": {
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": {
"packages": {
"@metamask/utils>@metamask/superstruct": true,
Expand Down Expand Up @@ -1082,7 +1088,8 @@
"@ethereumjs/tx": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": true,
"@metamask/eth-sig-util": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/types-live": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": true,
"browserify>buffer": true,
"webpack>events": true,
"@metamask/eth-trezor-keyring>hdkey": true
Expand Down Expand Up @@ -1116,6 +1123,17 @@
"@metamask/eth-sig-util>tweetnacl": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"@ethereumjs/tx>ethereum-cryptography": true,
"@metamask/eth-sig-util>tweetnacl": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
Expand Down Expand Up @@ -2064,6 +2082,21 @@
"semver": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"nock>debug": true,
"@metamask/utils>pony-cause": true,
"semver": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand Down
35 changes: 34 additions & 1 deletion lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,12 @@
"@metamask/eth-json-rpc-middleware>@metamask/utils": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": {
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": {
"packages": {
"@metamask/utils>@metamask/superstruct": true,
Expand Down Expand Up @@ -1174,7 +1180,8 @@
"@ethereumjs/tx": true,
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth": true,
"@metamask/eth-sig-util": true,
"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/types-live": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": true,
"browserify>buffer": true,
"webpack>events": true,
"@metamask/eth-trezor-keyring>hdkey": true
Expand Down Expand Up @@ -1208,6 +1215,17 @@
"@metamask/eth-sig-util>tweetnacl": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true,
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"@ethereumjs/tx>ethereum-cryptography": true,
"@metamask/eth-sig-util>tweetnacl": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
Expand Down Expand Up @@ -2156,6 +2174,21 @@
"semver": true
}
},
"@metamask/eth-ledger-bridge-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@noble/hashes": true,
"@metamask/utils>@scure/base": true,
"browserify>buffer": true,
"nock>debug": true,
"@metamask/utils>pony-cause": true,
"semver": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
"@metamask/ens-resolver-snap": "^0.1.2",
"@metamask/eth-json-rpc-filters": "^9.0.0",
"@metamask/eth-json-rpc-middleware": "^15.1.2",
"@metamask/eth-ledger-bridge-keyring": "^5.0.1",
"@metamask/eth-ledger-bridge-keyring": "^8.0.1",
"@metamask/eth-query": "^4.0.0",
"@metamask/eth-sig-util": "^7.0.1",
"@metamask/eth-snap-keyring": "^7.0.0",
Expand Down
45 changes: 23 additions & 22 deletions ui/components/app/snaps/snap-home-page/snap-home-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ export const SnapHomeRenderer = ({ snapId }) => {
}
}, [unapprovedTemplatedConfirmations, unapprovedConfirmations, history]);

Check warning on line 65 in ui/components/app/snaps/snap-home-page/snap-home-renderer.js

View workflow job for this annotation

GitHub Actions / Test lint / Test lint

React Hook useEffect has a missing dependency: 'snapId'. Either include it or remove the dependency array

return (
<Box
height={BlockSize.Full}
width={BlockSize.Full}
backgroundColor={BackgroundColor.backgroundAlternative}
style={{
overflowY: 'auto',
}}
>
{error && (
if (error) {
return (
<Box
height={BlockSize.Full}
width={BlockSize.Full}
backgroundColor={BackgroundColor.backgroundAlternative}
style={{
overflowY: 'auto',
}}
>
<Box height={BlockSize.Full} padding={4}>
<SnapDelineator snapName={snapName} type={DelineatorType.Error}>
<Text variant={TextVariant.bodySm} marginBottom={4}>
Expand All @@ -82,18 +82,19 @@ export const SnapHomeRenderer = ({ snapId }) => {
<Copyable text={error.message} />
</SnapDelineator>
</Box>
)}
{(interfaceId || loading) && (
<SnapUIRenderer
snapId={snapId}
interfaceId={interfaceId}
isLoading={loading}
useDelineator={false}
useFooter
contentBackgroundColor={BackgroundColor.backgroundAlternative}
/>
)}
</Box>
</Box>
);
}

return (
<SnapUIRenderer
snapId={snapId}
interfaceId={interfaceId}
isLoading={loading}
useDelineator={false}
useFooter
contentBackgroundColor={BackgroundColor.backgroundAlternative}
/>
);
};

Expand Down
6 changes: 5 additions & 1 deletion ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ const SnapUIRendererComponent = ({

const { state: initialState, context } = interfaceState;

// The renderer should only have a footer if there is a default cancel action
// or if the footer component has been used.
const hasFooter = onCancel || content?.props?.children?.[1] !== undefined;

return useDelineator ? (
<SnapDelineator
snapName={snapName}
Expand Down Expand Up @@ -133,7 +137,7 @@ const SnapUIRendererComponent = ({
backgroundColor={contentBackgroundColor}
style={{
overflowY: 'auto',
marginBottom: useFooter ? '80px' : '0',
marginBottom: useFooter && hasFooter ? '80px' : '0',
}}
>
<MetaMaskTemplateRenderer sections={sections} />
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/routes/routes.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ export default class Routes extends Component {
totalUnapprovedConfirmationCount: PropTypes.number.isRequired,
currentExtensionPopupId: PropTypes.number,
clearEditedNetwork: PropTypes.func.isRequired,
oldestPendingApproval: PropTypes.object.isRequired,
oldestPendingApproval: PropTypes.object,
pendingApprovals: PropTypes.arrayOf(PropTypes.object).isRequired,
transactionsMetadata: PropTypes.arrayOf(PropTypes.object).isRequired,
transactionsMetadata: PropTypes.object,
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
isShowKeyringSnapRemovalResultModal: PropTypes.bool.isRequired,
hideShowKeyringSnapRemovalResultModal: PropTypes.func.isRequired,
Expand Down
20 changes: 0 additions & 20 deletions ui/pages/snaps/snap-view/snap-home.js

This file was deleted.

4 changes: 2 additions & 2 deletions ui/pages/snaps/snap-view/snap-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
import { Content, Page } from '../../../components/multichain/pages/page';
import SnapAuthorshipHeader from '../../../components/app/snaps/snap-authorship-header';
import SnapHomeMenu from '../../../components/app/snaps/snap-home-menu';
import { SnapHomeRenderer } from '../../../components/app/snaps/snap-home-page/snap-home-renderer';
import SnapSettings from './snap-settings';
import SnapHome from './snap-home';

function SnapView() {
const history = useHistory();
Expand Down Expand Up @@ -129,7 +129,7 @@ function SnapView() {
resetInitRemove={resetInitRemove}
/>
) : (
<SnapHome snapId={snapId} />
<SnapHomeRenderer snapId={snapId} />
)}
</Content>
</Page>
Expand Down
Loading

0 comments on commit b036d93

Please sign in to comment.