-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00214e6
commit 84c43c4
Showing
18 changed files
with
209 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
"branches": 89.51, | ||
"functions": 96.2, | ||
"lines": 97.09, | ||
"statements": 96.75 | ||
"statements": 96.76 | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"branches": 95.38, | ||
"branches": 95.5, | ||
"functions": 100, | ||
"lines": 98.7, | ||
"statements": 95.75 | ||
"lines": 98.72, | ||
"statements": 95.81 | ||
} |
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 @@ | ||
import { bytesToHex, stringToBytes } from '@metamask/utils'; | ||
import { base64 } from '@scure/base'; | ||
|
||
import { AuxiliaryFileEncoding, encodeAuxiliaryFile } from './auxiliaryFiles'; | ||
|
||
describe('encodeAuxiliaryFile', () => { | ||
it('returns value without modifying it for base64', () => { | ||
const value = base64.encode(stringToBytes('foo')); | ||
expect( | ||
encodeAuxiliaryFile(value, AuxiliaryFileEncoding.Base64), | ||
).toStrictEqual(value); | ||
}); | ||
|
||
it('re-encodes to hex when requested', () => { | ||
const bytes = stringToBytes('foo'); | ||
const value = base64.encode(bytes); | ||
expect(encodeAuxiliaryFile(value, AuxiliaryFileEncoding.Hex)).toStrictEqual( | ||
bytesToHex(bytes), | ||
); | ||
}); | ||
}); |
Oops, something went wrong.