-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat-update-permit-redesign-spending-cap-…
…copy
- Loading branch information
Showing
43 changed files
with
988 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
.yarn/patches/@metamask-eth-ledger-bridge-keyring-npm-2.0.1-7a5d815b2d.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/dist/ledger-keyring.js b/dist/ledger-keyring.js | ||
index 2386b2e7fe36d1e65ef74f0a19d3b41450dcfa48..f999a0ab465cce7a450a5812f1d7aa6e39b74aed 100644 | ||
--- a/dist/ledger-keyring.js | ||
+++ b/dist/ledger-keyring.js | ||
@@ -150,7 +150,12 @@ class LedgerKeyring extends events_1.EventEmitter { | ||
}); | ||
} | ||
catch (error) { | ||
- throw error instanceof Error ? error : new Error('Unknown error'); | ||
+ | ||
+ /** | ||
+ * For Fixing issue 22837, when ledger is locked and didnt open the ethereum app in ledger, | ||
+ * The extension will always show `unknown error`, below change will transform the error to something meaningful. | ||
+ */ | ||
+ throw error instanceof Error ? error : new Error('Unlock your Ledger device and open the ETH app'); | ||
} | ||
if (updateHdk && payload.chainCode) { | ||
this.hdk.publicKey = buffer_1.Buffer.from(payload.publicKey, 'hex'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { withFixtures, defaultGanacheOptions, WINDOW_TITLES } from '../helpers'; | ||
import { Driver } from '../webdriver/driver'; | ||
import FixtureBuilder from '../fixture-builder'; | ||
import { | ||
buildQuote, | ||
reviewQuote, | ||
waitForTransactionToComplete, | ||
checkActivityTransaction, | ||
} from '../tests/swaps/shared'; | ||
import { installSnapSimpleKeyring } from './common'; | ||
|
||
const DAI = 'DAI'; | ||
const TEST_ETH = 'TESTETH'; | ||
|
||
describe('Snap Account - Swap', function () { | ||
it('swaps ETH for DAI using a snap account', async function () { | ||
await withFixtures( | ||
{ | ||
fixtures: new FixtureBuilder().build(), | ||
ganacheOptions: defaultGanacheOptions, | ||
title: this.test?.fullTitle(), | ||
}, | ||
async ({ driver }: { driver: Driver }) => { | ||
await installSnapSimpleKeyring(driver, false); | ||
await driver.switchToWindowWithTitle( | ||
WINDOW_TITLES.ExtensionInFullScreenView, | ||
); | ||
await buildQuote(driver, { | ||
amount: 0.001, | ||
swapTo: DAI, | ||
}); | ||
await reviewQuote(driver, { | ||
amount: 0.001, | ||
swapFrom: TEST_ETH, | ||
swapTo: DAI, | ||
}); | ||
await driver.clickElement({ text: 'Swap', tag: 'button' }); | ||
await waitForTransactionToComplete(driver, { tokenName: 'DAI' }); | ||
await checkActivityTransaction(driver, { | ||
index: 0, | ||
amount: '0.001', | ||
swapFrom: TEST_ETH, | ||
swapTo: DAI, | ||
}); | ||
}, | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Driver } from '../../webdriver/driver'; | ||
|
||
class HeaderNavbar { | ||
private driver: Driver; | ||
|
||
private accountMenuButton: string; | ||
|
||
constructor(driver: Driver) { | ||
this.driver = driver; | ||
this.accountMenuButton = '[data-testid="account-menu-icon"]'; | ||
} | ||
|
||
async openAccountMenu(): Promise<void> { | ||
await this.driver.clickElement(this.accountMenuButton); | ||
} | ||
} | ||
|
||
export default HeaderNavbar; |
Oops, something went wrong.