-
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 getWeiHexFromDecimalValue-error
- Loading branch information
Showing
37 changed files
with
394 additions
and
167 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,23 @@ | ||
import { showSnapAccountExperimentalToggle } from './snap-accounts'; | ||
|
||
describe('showSnapAccountExperimentalToggle', () => { | ||
beforeEach(() => { | ||
process.env = Object.assign(process.env, { | ||
KEYRING_SNAPS_AVAILABILITY_DATE: '02 Nov 2023 15:00:00 GMT', | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
delete process.env.KEYRING_SNAPS_AVAILABILITY_DATE; | ||
}); | ||
|
||
it('returns false if the current date is before November 2, 2023', () => { | ||
jest.useFakeTimers().setSystemTime(new Date(Date.UTC(2023, 9, 31, 5))); | ||
expect(showSnapAccountExperimentalToggle()).toBe(false); | ||
}); | ||
|
||
it('returns true if the current date is after November 2, 2023', () => { | ||
jest.useFakeTimers().setSystemTime(new Date(Date.UTC(2023, 10, 3, 5))); | ||
expect(showSnapAccountExperimentalToggle()).toBe(true); | ||
}); | ||
}); |
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,21 @@ | ||
///: BEGIN:ONLY_INCLUDE_IN(build-main) | ||
/** | ||
* Compares the current date to a specific date in UTC. | ||
* This method is meant to be used in a specific case related to the | ||
* Snap Accounts API. It should not be used in other cases. | ||
* Note: Months are 0-indexed in JS, so 10 represents November | ||
* | ||
* @returns true if the current date is after the specified date, false otherwise. | ||
*/ | ||
export function showSnapAccountExperimentalToggle(): boolean { | ||
const keyringSnapsAvailabilityDate = | ||
process.env.KEYRING_SNAPS_AVAILABILITY_DATE; | ||
if (!keyringSnapsAvailabilityDate) { | ||
return false; | ||
} | ||
|
||
return ( | ||
new Date().getTime() > new Date(keyringSnapsAvailabilityDate).getTime() | ||
); | ||
} | ||
///: END:ONLY_INCLUDE_IN |
55 changes: 0 additions & 55 deletions
55
test/e2e/accounts/settings-add-snap-account-toggle.spec.js
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export const TEST_SNAPS_SIMPLE_KEYRING_WEBSITE_URL = | ||
'https://metamask.github.io/snap-simple-keyring/0.4.0/'; | ||
'https://metamask.github.io/snap-simple-keyring/1.0.1/'; |
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
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
Oops, something went wrong.