-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: remove defaultGanacheOptions
#30728
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -531,17 +531,7 @@ const PRIVATE_KEY_TWO = | |
const ACCOUNT_1 = '0x5cfe73b6021e818b776b421b1c4db2474086a7e1'; | ||
const ACCOUNT_2 = '0x09781764c08de8ca82e156bbf156a3ca217c7950'; | ||
|
||
const defaultGanacheOptions = { | ||
accounts: [ | ||
{ | ||
secretKey: PRIVATE_KEY, | ||
balance: convertETHToHexGwei(DEFAULT_GANACHE_ETH_BALANCE_DEC), | ||
}, | ||
], | ||
}; | ||
|
||
const defaultGanacheOptionsForType2Transactions = { | ||
...defaultGanacheOptions, | ||
// EVM version that supports type 2 transactions (EIP1559) | ||
hardfork: 'london', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: You might be able to remove this one as well right now. The default hardfork in ganache already supports type2 transactions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good observation !! So at the time the Ganache class was defined, it was set as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ Added a task here for me to address this next: https://github.com/MetaMask/MetaMask-planning/issues/4368 |
||
}; | ||
|
@@ -956,7 +946,6 @@ module.exports = { | |
switchToOrOpenDapp, | ||
connectToDapp, | ||
multipleGanacheOptions, | ||
defaultGanacheOptions, | ||
defaultGanacheOptionsForType2Transactions, | ||
multipleGanacheOptionsForType2Transactions, | ||
sendTransaction, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,12 @@ const { strict: assert } = require('assert'); | |
const FixtureBuilder = require('../../fixture-builder'); | ||
const { | ||
withFixtures, | ||
generateGanacheOptions, | ||
defaultGanacheOptions, | ||
unlockWallet, | ||
genRandInitBal, | ||
getCleanAppState, | ||
} = require('../../helpers'); | ||
|
||
describe('MetaMetrics ID persistence', function () { | ||
it('MetaMetrics ID should persist when the user opts-out and then opts-in again of MetaMetrics collection', async function () { | ||
const { initialBalanceInHex } = genRandInitBal(); | ||
|
||
const initialMetaMetricsId = 'test-metrics-id'; | ||
|
||
await withFixtures( | ||
|
@@ -23,14 +18,6 @@ describe('MetaMetrics ID persistence', function () { | |
participateInMetaMetrics: true, | ||
}) | ||
.build(), | ||
localNodeOptions: generateGanacheOptions({ | ||
accounts: [ | ||
{ | ||
secretKey: defaultGanacheOptions.accounts[0].secretKey, | ||
balance: initialBalanceInHex, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no reason at all to start with a random balance, as this is not checked in the test, which we just check metric related topics, so we can remove it safely |
||
}, | ||
], | ||
}), | ||
title: this.test.fullTitle(), | ||
}, | ||
async ({ driver }) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is '25ETH' to the account corresponding to the default SRP (both ganache and anvil), so it can be removed, as it's in the node class level, and adding this to a spec has no effect