From 2d8c551749b1cbc886276d612664e88894090be2 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 26 Jan 2019 22:46:35 +0000 Subject: [PATCH] fix: `signTransaction` should return ` Promise` --- packages/web3-eth-accounts/types/index.d.ts | 2 +- packages/web3-eth-accounts/types/tests/accounts-tests.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/web3-eth-accounts/types/index.d.ts b/packages/web3-eth-accounts/types/index.d.ts index e5cb1a7167b..c6a0ab44d9f 100644 --- a/packages/web3-eth-accounts/types/index.d.ts +++ b/packages/web3-eth-accounts/types/index.d.ts @@ -30,7 +30,7 @@ export class Accounts extends AbstractWeb3Module { privateKeyToAccount(privateKey: string): Account; - signTransaction(tx: Transaction, privateKey: string, callback?: () => void): SignedTransaction; + signTransaction(tx: Transaction, privateKey: string, callback?: () => void): Promise; recoverTransaction(signature: string): string; diff --git a/packages/web3-eth-accounts/types/tests/accounts-tests.ts b/packages/web3-eth-accounts/types/tests/accounts-tests.ts index ad92d0202c7..78dcd8ec07f 100644 --- a/packages/web3-eth-accounts/types/tests/accounts-tests.ts +++ b/packages/web3-eth-accounts/types/tests/accounts-tests.ts @@ -28,14 +28,14 @@ accounts.create('2435@#@#@±±±±!!!!678543213456764321§3456754321345678543213 // $ExpectType Account accounts.privateKeyToAccount('0x348ce564d427a3311b6536bbcff9390d69395b06ed6c486954e971d960fe8709'); -// $ExpectType SignedTransaction +// $ExpectType Promise accounts.signTransaction({ to: '0xF0109fC8DF283027b6285cc889F5aA624EaC1F55', value: '1000000000', gas: 2000000 }, '0x4c0883a69102937d6231471b5dbb6204fe5129617082792ae468d01a3f362318'); -// $ExpectType SignedTransaction +// $ExpectType Promise accounts.signTransaction({ to: '0xF0109fC8DF283027b6285cc889F5aA624EaC1F55', value: '1000000000',