aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'packages/subproviders/test/integration')
-rw-r--r--packages/subproviders/test/integration/ledger_subprovider_test.ts22
1 files changed, 21 insertions, 1 deletions
diff --git a/packages/subproviders/test/integration/ledger_subprovider_test.ts b/packages/subproviders/test/integration/ledger_subprovider_test.ts
index 169e15504..7f319ed4e 100644
--- a/packages/subproviders/test/integration/ledger_subprovider_test.ts
+++ b/packages/subproviders/test/integration/ledger_subprovider_test.ts
@@ -85,7 +85,7 @@ describe('LedgerSubprovider', () => {
});
ledgerProvider.sendAsync(payload, callback);
});
- it('signs a personal message', (done: DoneCallback) => {
+ it('signs a personal message with eth_sign', (done: DoneCallback) => {
(async () => {
const messageHex = ethUtils.bufferToHex(ethUtils.toBuffer('hello world'));
const accounts = await ledgerSubprovider.getAccountsAsync();
@@ -105,6 +105,26 @@ describe('LedgerSubprovider', () => {
ledgerProvider.sendAsync(payload, callback);
})().catch(done);
});
+ it('signs a personal message with personal_sign', (done: DoneCallback) => {
+ (async () => {
+ const messageHex = ethUtils.bufferToHex(ethUtils.toBuffer('hello world'));
+ const accounts = await ledgerSubprovider.getAccountsAsync();
+ const signer = accounts[0];
+ const payload = {
+ jsonrpc: '2.0',
+ method: 'personal_sign',
+ params: [messageHex, signer],
+ id: 1,
+ };
+ const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ expect(err).to.be.a('null');
+ expect(response.result.length).to.be.equal(132);
+ expect(response.result.substr(0, 2)).to.be.equal('0x');
+ done();
+ });
+ ledgerProvider.sendAsync(payload, callback);
+ })().catch(done);
+ });
it('signs a transaction', (done: DoneCallback) => {
const tx = {
to: '0xafa3f8684e54059998bc3a7b0d2b0da075154d66',