-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added mock files (from cosmos-metamask-snap) - Removed unused files from test ui - Improved styles of test ui - Exported helper function to create SeiWallet for MM Snap
- Loading branch information
1 parent
e3c476e
commit 83da2c7
Showing
19 changed files
with
954 additions
and
266 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 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
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,36 @@ | ||
import { onRpcRequest } from '..'; | ||
import snapMock from './mocks/snap.mock'; | ||
import input from './mocks/input.mock'; | ||
import output from './mocks/output.mock'; | ||
|
||
describe('OnRPCRequest', () => { | ||
it('getPrivateKey', async () => { | ||
(global as any).snap = snapMock.success; | ||
|
||
const resp: any = await onRpcRequest(input.success.getPrivateKey); | ||
|
||
expect(resp).toMatchObject(output.success.getPrivateKey); | ||
}); | ||
|
||
it('signDirect', async () => { | ||
(global as any).snap = snapMock.success; | ||
|
||
const resp: any = await onRpcRequest(input.success.signDirect); | ||
expect(resp.signed).toMatchObject(output.success.signDirect.signed); | ||
expect(resp.signature).toHaveProperty('signature'); | ||
expect(resp.signature.pub_key).toStrictEqual(output.success.signDirect.signature.pub_key); | ||
}); | ||
|
||
it('signAmino', async () => { | ||
(global as any).snap = snapMock.success; | ||
|
||
const resp: any = await onRpcRequest(input.success.signAmino); | ||
expect(resp.signed).toMatchObject(output.success.signAmino.signed); | ||
expect(resp.signature).toHaveProperty('signature'); | ||
expect(resp.signature.pub_key).toStrictEqual(output.success.signAmino.signature.pub_key); | ||
}); | ||
|
||
it('invalid method', async () => { | ||
await expect(onRpcRequest(input.failure.invalidMethod)).rejects.toThrow(output.failure.invalidMethod); | ||
}); | ||
}); |
Oops, something went wrong.