-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Wallet] Enable 8 digit code verification and ignore attestation serv…
…ices below 1.1.0 (#6437) ### Description Enable 8 digit code verification and ignore attestation services below 1.1.0 as they do not support 8 digit codes. ### Other changes Force EOA address as a signer to provide signature for attestation services. ### Tested Android manual input and auto-import using attestation service 1.2.0 on alfajores. ### Related issues - Fixes #6097 ### Backwards compatibility Yes
- Loading branch information
Showing
12 changed files
with
88 additions
and
58 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { isVersionBelowMinimum } from 'src/utils/versionCheck' | ||
describe('Version check', () => { | ||
it('Correctly check if version is deprecated', () => { | ||
expect(isVersionBelowMinimum('1.5.0', '1.4.0')).toBe(false) | ||
expect(isVersionBelowMinimum('1.4.0', '1.5.0')).toBe(true) | ||
expect(isVersionBelowMinimum('1.4.0', '1.4.0')).toBe(false) | ||
expect(isVersionBelowMinimum('1.4.0', '1.4.0.1')).toBe(true) | ||
expect(isVersionBelowMinimum('1.4.0-unstable', '1.4.0')).toBe(false) | ||
}) | ||
}) |
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,16 @@ | ||
export function isVersionBelowMinimum(version: string, minVersion: string): boolean { | ||
const minVersionArray = minVersion.split('.') | ||
const versionArray = version.split('.') | ||
const minVersionLength = Math.min(minVersionArray.length, version.length) | ||
for (let i = 0; i < minVersionLength; i++) { | ||
if (minVersionArray[i] > versionArray[i]) { | ||
return true | ||
} else if (minVersionArray[i] < versionArray[i]) { | ||
return false | ||
} | ||
} | ||
if (minVersionArray.length > versionArray.length) { | ||
return true | ||
} | ||
return false | ||
} |
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